arXiv:2611.24489v1 cs.CR

수정 역전 완화: 함수 수준 취약점 탐지를 위한 반사실적 제약

Mitigating fix reversal: Counterfactual constraints for function-level vulnerability detection

Yun Bian, Shihao Li, Haiquan Wang, Yi Chen, Zhao Yang, Zhe Cui

제출 2026-11-19

한국어 초록

함수 수준 취약점 탐지기는 종종 수정 역전(fix reversal)을 보여, 수정된 버전에 취약한 대응 버전보다 더 높은 취약점 확률을 할당한다. 수정은 보통 함수를 길게 만들며, 길이 증가가 클수록 역전이 더 심한 것과 연관된다. 코드 변환 실험은 수정 역전이 주로 길이 지름길(length shortcut), 즉 내용이 고정되었을 때 함수 길이가 늘어날수록 취약점 확률이 증가하는 현상에서 비롯됨을 시사한다. 이 문제를 해결하기 위해 우리는 CFVul을 제안한다. 슬라이딩 윈도 인코딩은 완전한 함수를 포괄하여 절단 경계를 넘어선 수정 정보를 보존한다. 학습 중에는 내용 제약이 공통 길이 입력 하에서 취약한 버전이 더 높은 취약점 확률을 받도록 유도한다. 추론 중에는 길이 제약이 고정된 기준 길이들에 대해 취약점 확률을 평균하여 실제 길이 변화의 영향을 줄인다. PrimeVul에서 CFVul은 수정 쌍 순위 지표인 PairRank 59.4\%를 달성하여 비교한 기존 방법들을 능가한다. 함수 길이를 15\% 넘게 증가시키는 수정의 경우, PairRank는 CodeBERT의 25.8\%에서 48.4\%로 상승한다. PairRank는 네 가지 추가 모델과 세 가지 추가 데이터셋을 사용한 실험에서도 향상된다. 길이 지름길을 약화시킴으로써 CFVul은 수정된 버전이 취약한 버전보다 더 높은 취약점 확률을 받는 사례를 줄인다. 이 방법은 기존의 수정 쌍만 필요로 하고 여러 사전 학습 코드 모델에 적용할 수 있어 기존 탐지기에 쉽게 도입할 수 있다.

원문 초록

Function-level vulnerability detectors often exhibit fix reversal, assigning a higher vulnerability probability to a fixed version than to its vulnerable counterpart. Fixes usually lengthen functions, and larger length increases are associated with more severe reversal. Code-transformation experiments indicate that fix reversal mainly stems from a length shortcut: vulnerability probability increases with function length when content is fixed. We propose CFVul to address this problem. Sliding-window encoding covers complete functions, retaining fix information beyond the truncation boundary. During training, a content constraint encourages the vulnerable version to receive a higher vulnerability probability under a common length input. During inference, a length constraint averages vulnerability probabilities over fixed reference lengths, reducing the influence of actual length changes. On PrimeVul, CFVul achieves a fix-pair ranking metric, PairRank, of 59.4\%, exceeding the existing methods compared. For fixes that increase function length by more than 15\%, PairRank rises from CodeBERT's 25.8\% to 48.4\%. PairRank also improves in experiments with four additional models and three additional datasets. By weakening the length shortcut, CFVul reduces cases in which fixed versions receive higher vulnerability probabilities than vulnerable versions. It requires only existing fix pairs and applies to multiple pretrained code models, facilitating adoption in existing detectors.

제출 이력

확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.

  1. arXiv:2611.24489v1제출 시각 미확인

함께 살펴볼 논문

공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.

공통 태그로 연결된 공개 논문이 아직 없습니다.

토론

이 논문과 연결된 포럼 글이 아직 없습니다.