Tianhe Lu, Sakuna Harinda Jayasundara, Spero Eric, Ewan D. Tempero, Robert Biddle, Giovanni Russello · 2026 · arXiv (Cornell University)
DOI: 10.48550/arxiv.2610.25133 · cited by 0 works (OpenAlex) · open-access PDF
Mặc dù nhiều phương pháp hiện có cải thiện bảo mật mã bằng cách sửa đổi các thông số mô hình hoặc đầu vào, làm thế nào các thay đổi đại diện liên quan đến các sửa chữa API mã hóa khác nhau có thể hỗ trợ sự can thiệp được chia sẻ để tạo ra mã an toàn hơn vẫn còn chưa được khám phá. Để điều tra điều này, chúng tôi xây dựng 48.000 cặp chương trình phù hợp trên bốn ngôn ngữ lập trình và mười loại API lạm dụng mã hóa. Mỗi cặp thay đổi một quyết định API cụ thể trong khi duy trì nhiệm vụ lập trình. Trừ đại diện nội bộ của chương trình lạm dụng từ đối tác an toàn của nó cung cấp một vector sửa chữa. Trên năm mô hình, so sánh trung bình các vector sửa chữa tiết lộ tổ chức mạnh hơn theo loại API lạm dụng theo ngôn ngữ. Những cặp này cũng hỗ trợ sự can thiệp được chia sẻ
Machine translation (Meta M2M100); the English original follows.
Cryptographic API misuse in large language model-generated code can compromise software security. While many existing approaches improve code security by modifying model parameters or inputs, how representation changes associated with different cryptographic API repairs can support a shared intervention for safer code generation remains underexplored. To investigate this, we construct 48,000 matched program pairs across four programming languages and ten cryptographic API misuse categories. Each pair changes a specified API decision while preserving the programming task. Subtracting the misuse program's internal representation from its secure counterpart's gives a repair vector. Across five models, comparisons of mean repair vectors reveal stronger organization by misuse category than by language. These category-specific patterns also support a shared intervention. We introduce CrypSteer, which extracts a shared direction by normalizing repair differences and selecting a principal component aligned with repairs across misuse categories. With model weights fixed, adding one shared direction per model to its internal activations during generation improves aggregate target security rates by 5.28--15.00 percentage points over unsteered generation across languages and misuse categories. These findings connect the shared structure of cryptographic repair representations to a reusable intervention for safer code generation.
Read in: English · Spanish · Chinese · Hindi · Arabic · Portuguese · French · German · Japanese · Russian · Korean · Indonesian · Vietnamese
Topics: SAFER, Computer science, Cryptographic primitive, Cryptography, Code (set theory), Component (thermodynamics)
GET https://store.agentexchange.work/gw/papers/verify?title=...&year=... (0.003 USD), fetch this record as JSON with /gw/papers/paper?id=2610.25133, or list what it cites with /gw/papers/references?id=.... Pay per call in USDC (x402) or with a 19 USD card key for 1,000 calls. Catalogue · llms.txtSources: OpenAlex (CC0), arXiv, Crossref. Agent Exchange