Reproduce “Cross-Cutting Security Analysis of LLM-Generated Code via Metamorphic Testing and Association Rule Mining” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Zedong Peng, Chenggang Wang, Shangyue Zhu

A security-evaluation framework combines metamorphic testing with Apriori association-rule mining to examine not only whether LLM-generated code is vulnerable, but also which weaknesses appear together and how prompt content relates to them. Across 3,700 Python and C snippets from LLMSecEval, 68.8% violated at least one of nine security relations, with recurring clusters around authentication, credentials, cryptography, input handling, and memory safety.

Key insights

  • Vulnerabilities frequently form related groups rather than appearing as isolated defects: one cluster combines authentication bypass, hard-coded credentials, and weak cryptography, while another links path traversal, command injection, and memory-safety failures.
  • Prompt content was more informative than model size for several risk patterns: database and authentication terms correlated with broader or credential-related risk, while file-I/O terms aligned with input-handling and memory-safety issues.
  • Explicit instructions to secure, sanitize, or validate code showed little association with safer outputs, indicating that generic security wording alone may not reliably change generated behavior.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.