CyberGuardAI 安全情报工作区
AI 安全知识情报
LJH 管理员
返回首页 学术论文

SecReason:LLM代码生成中的漏洞检测与流内自修复

Ruidong Han、Zhensu Sun、Chengyan Ma、Yuqing Niu、Siqi Ma、David Lo

历史版本 v1 · 查看当前版本

摘要与解读

提出生成中漏洞检测与自修复方法并给出基准结果

分析与审核记录

AI 情报分析

历史来源快照

资料档案

文献来源与参考链接

当前保存的来源版本 · v1

作者
Ruidong Han、Zhensu Sun、Chengyan Ma、Yuqing Niu、Siqi Ma、David Lo
文献与标准标识
arxiv:2610.14453
主题分类
cs.CR、cs.SE
来源版本
v1
来源更新时间
2026-10-10T01:27:55+00:00
日期依据
来源明确给出发表日期
原始标题与分类记录

SecReason: Vulnerability Detection and In-Stream Self-Repair for LLM Code Generation

研究方向
防御技术
影响维度
待人工确认
风险类型
供应链风险
相关技术
LLM

当前为离线关键词规则模式。

分类规则与原始字段
防御技术 · defense
e reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each st
供应链风险 · vulnerability
SecReason: Vulnerability Detection and In-Stream Self-Repair for LLM Code Generation Large language models (LLMs) may introd
LLM · llm
Vulnerability Detection and In-Stream Self-Repair for LLM Code Generation Large language models (LLMs) may introduce security vulnerabilities into generated
{
  "ai_relevance": {
    "evidence": [
      {
        "end_offset": 68,
        "location": "title_and_content",
        "quote": "LLM",
        "rule": "ai_term",
        "start_offset": 65
      },
      {
        "end_offset": 106,
        "location": "title_and_content",
        "quote": "Large language models",
        "rule": "ai_term",
        "start_offset": 85
      },
      {
        "end_offset": 112,
        "location": "title_and_content",
        "quote": "LLMs",
        "rule": "ai_term",
        "start_offset": 108
      },
      {
        "end_offset": 580,
        "location": "title_and_content",
        "quote": "LLMs",
        "rule": "ai_term",
        "start_offset": 576
      }
    ],
    "matches": [
      {
        "end_offset": 68,
        "location": "title_and_content",
        "quote": "LLM",
        "rule": "ai_term",
        "start_offset": 65
      },
      {
        "end_offset": 106,
        "location": "title_and_content",
        "quote": "Large language models",
        "rule": "ai_term",
        "start_offset": 85
      },
      {
        "end_offset": 112,
        "location": "title_and_content",
        "quote": "LLMs",
        "rule": "ai_term",
        "start_offset": 108
      },
      {
        "end_offset": 580,
        "location": "title_and_content",
        "quote": "LLMs",
        "rule": "ai_term",
        "start_offset": 576
      }
    ],
    "method": "explainable_keyword_rules",
    "reason": "Matched AI topic or component evidence",
    "relevant": true
  },
  "entity_ids": [],
  "facts": [],
  "method": "source_grounded_extraction",
  "unknown_fields": [
    "affected_products",
    "affected_versions",
    "fixed_versions",
    "cvss",
    "mitigations",
    "references",
    "papers",
    "poc"
  ]
}
原始采集文本
Large language models (LLMs) may introduce security vulnerabilities into generated code, which can persist into production when verification focuses on functional correctness. Existing defenses act before, during, or after generation, but none inspects the code during generation. Security prompts and retrieved security knowledge act before any code exists, constrained decoding limits token choices but cannot guide repair, and post-hoc repair must regenerate the full response. Reasoning LLMs draft code early in their streamed chain of thought, and in this pre-delivery window the code exists only inside the reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each statement as it is emitted and tracing dataflows across the accumulated code. When a security rule fires, SecReason interrupts generation, inserts an in-stream warning, and resumes decoding, so the model repairs the draft within the same reasoning trace without regenerating the full response. On tasks where unassisted generation introduces vulnerabilities, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}. \system consumes fewer tokens than post-hoc repair, and when security rules misfire on secure code, it limits the functional regressions from false warnings.
采集信息与校验
完整来源元数据
{
  "authors": [
    "Ruidong Han",
    "Zhensu Sun",
    "Chengyan Ma",
    "Yuqing Niu",
    "Siqi Ma",
    "David Lo"
  ],
  "content_level": "abstract",
  "date_basis": "explicit_published",
  "date_evidence": {
    "published": "2026-10-10T01:27:55Z",
    "updated": "2026-10-10T01:27:55Z"
  },
  "identifiers": [
    "arxiv:2610.14453"
  ],
  "source_updated_at": "2026-10-10T01:27:55+00:00",
  "subjects": [
    "cs.CR",
    "cs.SE"
  ],
  "version_label": "v1"
}
原文版本历史与校验
版本入库更新时间来源发布日期校验标识
v22026-10-15 01:22 UTC2026-10-10 01:27 UTC8eb4add8b5e4f6644433fbbb9bbf9570eb76f68543cadd56f6a6f8e5fd370733
v1 · 正在查看2026-10-14 01:50 UTC2026-10-10 01:27 UTC4984992c5357aef10344c398f260fdd167097d65d8cd1ae4791643ecdf555167
可引用分片 · 2 段

CHK-9b2bced13b9e7be4fe9d5e56

Large language models (LLMs) may introduce security vulnerabilities into generated code, which can persist into production when verification focuses on functional correctness. Existing defenses act before, during, or after generation, but none inspects the code during generation. Security prompts and retrieved security knowledge act before any code exists, constrained decoding limits token choices but cannot guide repair, and post-hoc repair must regenerate the full response. Reasoning LLMs draft code early in their streamed chain of thought, and in this pre-delivery window the code exists only inside the reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each statement as it is emitted and tracing dataflows across the accumulated code. When a security rule fires, SecReason interrupts generation, inserts an in-stream warning, and resumes decoding, so the model repairs the draft within the same reasoning trace without regenerating the full response. On tasks where unassisted generation introduces vulnerabilities, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}.

CHK-f338ba4bbed7260ba6070b1f

es, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}. \system consumes fewer tokens than post-hoc repair, and when security rules misfire on secure code, it limits the functional regressions from false warnings.

中文译文

正文译文暂缺,以下仅为中文摘要。

中文摘要

提出生成中漏洞检测与自修复方法并给出基准结果

已采集原文

访问来源网页

Large language models (LLMs) may introduce security vulnerabilities into generated code, which can persist into production when verification focuses on functional correctness. Existing defenses act before, during, or after generation, but none inspects the code during generation. Security prompts and retrieved security knowledge act before any code exists, constrained decoding limits token choices but cannot guide repair, and post-hoc repair must regenerate the full response. Reasoning LLMs draft code early in their streamed chain of thought, and in this pre-delivery window the code exists only inside the reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each statement as it is emitted and tracing dataflows across the accumulated code. When a security rule fires, SecReason interrupts generation, inserts an in-stream warning, and resumes decoding, so the model repairs the draft within the same reasoning trace without regenerating the full response. On tasks where unassisted generation introduces vulnerabilities, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}. \system consumes fewer tokens than post-hoc repair, and when security rules misfire on secure code, it limits the functional regressions from false warnings.