SecLLM
GitHub
Open Dataset · Model Weights · Training Recipe

소스코드를 밖으로 보내지 않고
취약점을 고치는 모델
A model that fixes vulnerabilities
without your code leaving your network

정적분석이 찾은 취약점을 설명하고 고치는 모델을 자체 서버에서 돌릴 수 있도록, 학습 데이터셋과 모델 가중치, 학습·평가 방법을 오픈소스로 만들어 갑니다. So you can run a model that explains and fixes static-analysis findings on your own server, we are building the training dataset, the model weights, and the training and evaluation method in the open.

4,617레코드Records
101취약점 유형Defect types
9,736추적 이벤트Trace events
CC BY 4.0데이터셋 라이선스Dataset license
왜 필요한가Why it matters

취약점을 찾는 것만으로는 끝나지 않습니다Finding a vulnerability is only the start

정적분석기는 취약점의 위치와 유형을 알려 주지만, 왜 위험한지 설명하고 올바르게 고치는 일은 여전히 사람의 몫입니다. 이 일을 LLM에 맡기려면 먼저 풀어야 할 문제가 세 가지 있습니다. A static analyzer tells you where a defect is and what type it is, but explaining why it matters and fixing it correctly is still left to people. Handing that work to an LLM means solving three problems first.

1

학습 데이터에 맥락이 없다Training data lacks context

공개된 취약점 데이터셋 대부분은 함수 조각과 라벨의 쌍입니다. 파일 전체, 분석기가 따라간 데이터 흐름, 검증된 수정 코드가 빠져 있어 모델이 설명과 수정을 배울 재료가 부족합니다.Most public vulnerability datasets are (function, label) pairs. Without the whole file, the analyzer's data-flow trace, and a verified fix, a model has little to learn explanation and repair from.

2

소스코드를 밖으로 보낼 수 없다Source code cannot leave the network

큰 모델은 대개 코드를 외부 API로 보내야 쓸 수 있습니다. 코드 반출이 막힌 환경에서는 자체 서버에서 돌릴 수 있는 크기의 모델이 필요합니다.Large models usually need the code sent to an external API. Where code may not leave the network, the model has to be small enough to run on your own server.

3

고쳐졌는지 확인하기 어렵다A fix is hard to verify

재스캔만으로는 탐지만 피한 변경이나 의미 없는 변경을 걸러낼 수 없고, 모델 심사만으로는 취약점이 남은 수정을 놓칩니다.Re-scanning alone cannot tell a real fix from evasion or a no-op, and a model judge alone misses patches that leave the defect in place.

SecLLM이 하는 일What SecLLM does

문제별로 이렇게 해결합니다How SecLLM addresses each one

문제 1 → 데이터셋Problem 1 → Dataset

맥락까지 담은 검증된 레코드Verified records with full context

레코드마다 소스 파일 전체, source → branch → sink 추적 경로, 한·영 설명, 재분석으로 해결이 확인된 패치를 함께 담습니다. Java 레코드는 지금 바로 받을 수 있습니다.Every record carries the whole source file, the source → branch → sink trace, Korean and English explanations, and a patch confirmed by re-analysis. The Java records are available now.

데이터셋 자세히Dataset details
4,617레코드Records
101취약점 유형Defect types
9,736추적 이벤트Trace events
문제 2 → 모델Problem 2 → Model

자체 서버에서 도는 작은 모델Small models that run on your own server

큰 교사 모델의 조치 제안 능력을 Qwen3.5-9B와 Qwen3.6-27B에 QLoRA로 옮기고, vLLM으로 온프레미스 서빙합니다. 가중치는 Apache 2.0으로 공개할 예정이며 지금은 준비 중입니다.The teacher's remediation ability moves into Qwen3.5-9B and Qwen3.6-27B through QLoRA, served on-premises with vLLM. The weights will be released under Apache 2.0 and are in progress.

모델 자세히Model details
81.2%Qwen3.6-27B Fix rate · 파인튜닝 전Qwen3.6-27B fix rate · before fine-tuning
61.1%Qwen3.5-9B Fix rate · 파인튜닝 전Qwen3.5-9B fix rate · before fine-tuning
문제 3 → 평가Problem 3 → Evaluation

재스캔과 모델 심사를 합친 판정Re-scan plus model judge

패치를 적용한 뒤 규칙 기반 재스캔으로 취약점이 사라졌는지 먼저 확인하고, 규칙으로 가리기 어려운 사례만 다섯 항목의 모델 심사로 해소합니다.A rule-based re-scan first checks that the finding is gone after the patch; only cases rules cannot settle go to a five-criterion model judge.

평가 체계 자세히Evaluation details
remediation_outcome규칙 기반 재스캔Rule-based re-scan
remediation_quality5개 항목 모델 심사Five-criterion model judge
작동 방식How it works

수집부터 재검증까지 다섯 단계Five steps from collection to re-verification

1 · 수집1 · Collect

공개 오픈소스 코드를 SAST로 스캔해 취약점과 추적 경로를 모읍니다.Scan public open-source code with SAST to gather findings and traces.

2 · 페어 구성2 · Pair

취약점과, 재검증을 통과한 조치 코드를 한 레코드로 묶습니다.Pair each finding with a patch that passed re-verification.

3 · 증류 학습3 · Distill

큰 교사 모델의 조치 제안을 작은 학생 모델에 QLoRA로 옮깁니다.Move the teacher's remediation behaviour into a small student with QLoRA.

4 · 에이전트 실행4 · Run

문맥을 탐색하고 도구 호출로만 코드를 편집합니다.Explore the context, then edit code only through a tool call.

5 · 재검증5 · Verify

패치를 다시 스캔하고 품질 심사로 해결 여부를 확정합니다.Re-scan the patch and settle the outcome with a quality review.

세 가지 산출물Three artifacts

같은 입력 스키마를 공유하므로 셋을 따로 써도, 이어 붙여 재현해도 됩니다. All three share one input schema, so they work on their own or chained end to end.

데이터셋Dataset

공개됨Available

실제 오픈소스 코드에서 나온 취약점과, 재검증을 통과한 조치 코드의 쌍. 함수 조각이 아니라 소스 파일 전체를 담습니다. Real findings from open-source code paired with verified patches, carrying whole source files rather than snippets.

레코드Records
4,617
유형Types
101
형식Format
JSON Lines
라이선스License
CC BY 4.0
github.com/Sparrow-Co-Ltd/SecLLM-Dataset

모델Model

준비 중In progress

조치 제안에 특화해 파인튜닝한 가중치. 소스코드를 외부로 보낼 수 없는 환경에서 그대로 서빙할 수 있는 크기를 유지합니다. Weights fine-tuned for remediation, kept small enough to serve where source code cannot leave the network.

베이스Base
Qwen3.5-9B · Qwen3.6-27B
학습Method
QLoRA
서빙Serving
vLLM
라이선스License
Apache 2.0

구현Implementation

준비 중In progress

에이전트 파이프라인과 평가 하네스. 수집부터 조치 제안, 자동 재검증까지 그대로 재현할 수 있습니다. The agent pipeline and the evaluation harness: enough to reproduce collection, remediation, and automated verification.

스택Stack
LangChain · tree-sitter
연동Interop
SARIF 2.1.0
구성Repos
2
라이선스License
MIT

데이터셋Dataset

레코드 하나는 취약점 정보(input)와 그것을 해결하는 코드 수정(output)의 쌍입니다. 라인 번호는 모두 원본 코드 기준입니다. Each record pairs the finding (input) with the change that resolves it (output). All line numbers refer to the original file.

레코드에 담긴 것What a record holds

  • 취약점이 발생한 전체 소스 파일과 발생 라인The full source file and the reported line
  • 취약점 유형명과 설명 (한국어·영어)Defect type and description in Korean and English
  • 같은 유형의 위험 예시와 안전 예시 코드Vulnerable and safe example code for that type
  • 분석기 추적 경로 — source → branch → sinkThe analyzer trace: source, branch, sink
  • 재검증을 통과한 코드 수정 목록The verified list of code modifications

수집 방식How it is built

  • 허용적 라이선스로 배포된 공개 코드 코퍼스에서 언어별 소스 추출Language-wise extraction from a permissively licensed public code corpus
  • SAST CLI로 청크 단위 스캔 후 결과 증분 집계Chunked scanning with a SAST CLI, results aggregated incrementally
  • CWE·OWASP 매핑과 위험도별 커버리지 산출CWE and OWASP mapping, with coverage tracked by severity
  • 패치 적용 후 재분석에서 해결이 확인된 수정만 수록Only patches confirmed resolved by re-analysis are included
// 레코드 한 줄의 구조one record, one line
{
  "input": {
    "programmingLanguage": "Java",
    "issueNameEn": "Direct Use of Threads",
    "issueRisk": "높음높음 (high)",
    "issueLineNumber": 23,
    "entireCode": "package io.opentracing.contrib...",
    "contexts": [ { "lineNo": 23, "eventType": "sink", "message": "..." } ]
  },
  "output": [
    { "type": "delete", "startLine": 23, "endLine": 40, "content": null },
    { "type": "add",    "startLine": 23, "endLine": null, "content": "..." }
  ]
}
현재 공개본 — JavaCurrent release — Java
항목Item 값Value 비고Note
레코드Records4,617파일 하나당 한 건, 중복 없음One per file, no duplicates
취약점 유형Defect types101유형당 최대 100건Capped at 100 records per type
코드 길이File length9 / 117 / 2,998최소 / 중앙값 / 최대 (라인)min / median / max lines
추적 이벤트Trace events9,736레코드당 1~47개1 to 47 per record
파일 크기File size54 MBJSON Lines, UTF-8

라벨은 모두 정적분석기의 판정이며 실행으로 확인한 결과가 아닙니다. 오탐이 포함될 수 있고, 조치 코드는 같은 분석기 재검사로만 검증했습니다. Labels come from a static analyzer, not from execution. False positives are possible, and patches are verified only by re-running the same analyzer.

모델Model

큰 모델을 그대로 쓰는 대신, 조치 제안 능력만 작은 모델로 옮겨 자체 서버에서 돌릴 수 있게 만드는 것이 목표입니다. Rather than depend on a large model, the goal is to move remediation ability into a small one that runs on your own server.

교사 모델Teacher

DeepSeek-V4-Flash-0731. 후보 모델과 비교 평가한 뒤 선정했습니다.DeepSeek-V4-Flash-0731, chosen after a head-to-head evaluation against another candidate.

학생 모델Student

Qwen3.5-9B와 Qwen3.6-27B. 두 모델 모두 Apache 2.0이며 vLLM으로 온프레미스 서빙합니다.Qwen3.5-9B and Qwen3.6-27B, both Apache 2.0, served on-premises with vLLM.

파인튜닝Fine-tuning

QLoRA를 두 차례 적용합니다. 1차 학습 뒤 벤치마크로 확인하고, 2차에서 성능을 확정합니다.Two QLoRA runs: benchmark after the first, then confirm performance on the second.

학습 데이터Training data

취약점과 조치 방안을 짝지은 페어. 입력 필드는 공개 데이터셋과 동일해 그대로 재현할 수 있습니다.Defect-and-remediation pairs whose input fields match the public dataset exactly, so the setup is reproducible.

Fix rate Judge

Qwen3.5-9B

61.1%
41.6%

Qwen3.6-27B

81.2%
60.3%
그림 1. 파인튜닝 전 기준선 — 모델별 Fix rate와 Judge 점수. 수치는 아래 표와 같습니다.Figure 1. Pre-fine-tuning baseline — Fix rate and Judge score per model. Values match the table below.
파인튜닝 전 기준선 — Java, 자체 측정Pre-fine-tuning baseline — Java, measured in-house
모델Model Fix rate Judge 구문·컴파일 에러Syntax/compile errors
Qwen3.5-9B61.1%41.6%43
Qwen3.6-27B81.2%60.3%15

자체 파이프라인으로 측정한 잠정치이며 Java 단일 언어 기준입니다. 모델 규모가 커질수록 구문·컴파일 에러가 뚜렷하게 줄어, 학습 시 구문 정합성 데이터를 보강하는 방향을 잡았습니다. Provisional numbers from our own pipeline, Java only. Syntax and compile errors drop sharply with model size, which is why training emphasises syntactic correctness.

에이전트 파이프라인Agent pipeline

두 단계 그래프입니다. 탐색 단계가 근거를 모으고, 수정 단계는 자유 텍스트 대신 편집 도구 호출로만 코드를 바꿉니다. A two-stage graph: exploration gathers evidence, and the fix stage changes code only through an edit tool, never as free text.

START → explore → fix_branch → END

explore

  • 언어를 판별하고 전체 코드를 AST 청크로 분할Detect the language and split the file into AST chunks
  • 문제 라인을 포함한 청크와 이를 감싸는 클래스·함수 심볼 확인Find the chunk holding the reported line and its enclosing class and function
  • 추적 경로 이벤트로 source → sink 경로 구성Rebuild the source-to-sink path from trace events
  • 식별자의 선언 지점과 변경 지점 추적Track where identifiers are declared and modified

fix_branch

  • 이슈 메타데이터·코드 청크·분석 문맥·예시 코드를 프롬프트로 구성Compose the prompt from issue metadata, code chunks, analysis context, and examples
  • 모델이 편집 도구를 강제 호출하도록 설계Force the model to call the edit tool
  • 최대 3회 피드백 루프로 자체 검증, 적절하면 조기 종료Up to three self-check rounds, stopping early when the fix holds
  • 편집 결과를 삭제·추가 연산으로 변환하고 6종 검증Convert edits into delete and add operations, then run six checks

코드 청킹Code chunking

tree-sitter 기반 청킹 라이브러리를 포크해 C·C++·Go·JavaScript를 추가했습니다. 청크가 기준 길이를 넘으면 하위 노드로 재귀 분할합니다.A fork of a tree-sitter chunker adds C, C++, Go, and JavaScript; oversized chunks split recursively at child nodes.

표준 연동Standards

SARIF 2.1.0으로 다른 분석 도구의 결과도 받습니다. 공식 스키마 적합성과 왕복 변환 일치를 확인했습니다.SARIF 2.1.0 intake accepts results from other analyzers, validated against the official schema with round-trip checks.

평가 체계Evaluation

재스캔만으로는 탐지 회피나 의미 없는 변경을 걸러낼 수 없고, 모델 심사만으로는 취약점이 남은 수정을 놓칩니다. 두 축을 합쳐 해결 여부를 확정합니다. Re-scanning alone cannot tell a real fix from evasion or a no-op; a model judge alone misses patches that leave the defect in place. The two axes are combined.

remediation_outcome

패치를 적용한 뒤 재스캔에서 대상 취약점이 더 이상 검출되지 않는지 확인하는 규칙 기반 판정입니다.A rule-based check: after the patch, the target finding no longer appears in the re-scan.

remediation_quality

규칙으로 가리기 어려운 보류 사례만 모델 심사로 해소합니다. 아래 다섯 항목의 가중합입니다.A model judge resolves only what rules cannot settle, scoring the five criteria below.

평가 항목Criterion 가중치Weight 확인하는 것What it checks
fix validity0.35수정이 취약점을 실제로 없애는가Does the change actually remove the defect
no evasion0.25탐지만 피해 간 변경은 아닌가Is it merely evading detection
localization0.15문제 지점을 정확히 짚었는가Is the right location targeted
minimality0.15필요 이상으로 코드를 바꾸지 않았는가Is the change no larger than needed
exploration0.10근거를 충분히 탐색했는가Was the evidence explored properly

재현성 장치Reproducibility

  • 패치가 원본을 덮어쓰지 않도록 적용 순서를 고정Patch application order is fixed so originals are never overwritten
  • 고비용 모듈은 실행 1회를 보장해 중복 비용 차단Expensive modules are guaranteed to run exactly once
  • 공유 자원 충돌을 5단계 파이프라인으로 자동 조정Shared-resource contention is handled by a five-stage pipeline

바로 써 보기Try it

데이터셋은 표준 라이브러리만으로 읽을 수 있습니다. 저장소에는 스키마 검증 스크립트가 함께 들어 있습니다. The dataset reads with the standard library alone, and the repository ships a schema validator.

# 레코드 읽기read records
import json
records = [json.loads(l) for l in open("data/java/input.jsonl", encoding="utf-8")]
inp = records[0]["input"]
print(inp["issueNameEn"], inp["issueLineNumber"])

# 스키마 검증validate the schema
python scripts/validate.py
python scripts/validate.py --stats data/java/input.jsonl

오류 제보Report an error

오탐, 잘못된 유형, 잘못된 패치는 저장소 이슈로 알려 주세요. 재검증 후 다음 릴리스에 반영합니다.Flag false positives, wrong types, or bad patches in an issue; corrections ship in the next release after re-verification.

다른 도구 데이터Other tools' data

다른 분석기로 만든 취약점·조치 데이터는 출처를 붙여 커뮤니티 트랙으로 받습니다.Findings and fixes from other analyzers are accepted in a community track with provenance attached.

함께 만들어 주세요Build it with us

Star로 관심을 보여 주고, 오탐·잘못된 패치를 제보하거나 다른 도구의 데이터를 기여해 주세요. Star the repository, report false positives or bad patches, or contribute data from other tools.