Code audit is a systematic review of source code to find security vulnerabilities, logic flaws, and coding standard issues. It is a core white-box testing method. The process involves automated scanning (SAST) and manual review. The standard audit flow includes information gathering, static scanning, manual confirmation, penetration testing, and report output. Key tools include Fortify, SonarQube, and CodeQL. Common high-risk areas include identity authorization, file operations, and framework-specific features. The current market uses traditional manual audits, pure LLM audits, and a combined SAST+AI approach, with AI agents emerging for deeper analysis. The document also provides a detailed list of safe versions for various components, frameworks, and middleware to ensure security.
1. What Is a Code Audit?
A code audit is a systematic examination of software source code aimed at discovering security vulnerabilities, logic flaws, and coding standards violations.
It is the core practice of white-box testing in cybersecurity. Compared to penetration testing (black-box, attacking from the outside), a code audit looks directly under the hood and can uncover deeper, hidden risks.
Core Objectives:
Uncover security vulnerabilities: identify high-risk threats such as SQL injection, cross-site scripting (XSS), command execution, and more.
Inspect business logic: discover privilege escalation, payment tampering, process bypasses, and other issues that automated scanners miss.
Ensure compliance and quality: verify that code meets industry standards (e.g., China's Information Security Classified Protection 2.0) and eliminate hard-coded passwords, dead code, and the like.
In practice, the typical approach combines automated tooling (SAST scanning) with in-depth manual review.
Automated scanning: tools quickly sweep the entire codebase to flag known risk patterns (e.g., format string vulnerabilities).
Manual audit (the core): a security expert traces tainted data flows — following user input all the way into sensitive functions — and carefully reasons through complex logic such as authentication and cryptographic implementations. Business logic flaws, in particular, can almost only be discovered by a human reading the code.
When to Perform a Code Audit:
Audits are typically conducted before go-live or around major version releases. For systems in finance, government, and internet infrastructure, a code audit is a mandatory compliance “ticket to entry.”
2. The Audit Process
2.1 The Standard Five-Step Audit Process
Information gathering: confirm the tech stack (Java/Python/Go/JS, etc.), framework versions, and dependency inventory (to identify components with known vulnerabilities).
Static scanning: run automated tools (e.g., Fortify, SonarQube) for an initial “health check” and triage high-severity alerts.
Manual verification: deduplicate false positives, focus on tracing taint propagation paths (from source/sink parameters → function processing points), and dive deep into auditing the core permission checks and cryptographic logic.
Exploitation verification: for suspected vulnerabilities, write a PoC (proof of concept) and actually test it to confirm the flaw is truly exploitable, ruling out environmental factors.
Report delivery: compile the list of findings, accompanied by remediation advice and verification screenshots.
2.2 Mainstream Audit Tools
Heavyweight Commercial (Enterprise-grade)
Fortify (comprehensive rule set, well-suited for Java/C++) and Checkmarx (interactive scanning with a relatively lower false-positive rate).
Lightweight Open Source
SonarQube: focuses on code anomalies.
Semgrep: customizable rules, ideal for tailored audits.
CodeQL: exceptionally strong semantic analysis, suited for zero-day hunting.
2.3 Points to Note
“High-Risk Zones” Beginners Most Easily Overlook
Identity and privilege escalation: checking only whether a user is logged in, without verifying that the “operator ID” matches the “resource owner ID.”
File operations: allowing uploads with JSP/PHP extensions, or path strings containing ../ that lead to directory traversal.
Framework-specific quirks: e.g., unauthenticated access to Spring Boot Actuator endpoints, Shiro deserialization vulnerabilities.
2.4 Deliverables
Typically include a “Vulnerability Risk Classification Table” (Critical/High/Medium/Low), code remediation examples (not always mandatory but expected as standard practice, with a diff comparison), and secure coding guideline recommendations.
2.6 Code Auditing in the Current Market
Traditional manual audit school: Some projects have extremely high confidentiality requirements and strictly forbid the use of public-cloud AI models. Yet, at present, these teams lack their own on-premises large model, leaving them with no choice but pure manual effort.
LLM-only audit school: Feed the code directly to a large language model and let it find vulnerabilities.
The advantage is that it can understand business logic and uncover deep logical flaws. However, it faces engineering challenges such as "attention dilution (model hallucinations)," poor results from unfiltered full-code dumps, high output variance, and steep costs.
Static Analysis (SAST) + AI Augmentation
This is currently the most mainstream and pragmatic path. Traditional tools like Semgrep and CodeQL perform a rapid first-pass scan, and then AI conducts in-depth triage on the findings, dramatically slashing the false-positive rate.
Going further: AI is evolving into AI Agents with full closed-loop capability
Deep mining: Analyze cross-file data flows, call chains, and complex business context.
Auto-verification: Write PoC (proof-of-concept) code and verify the vulnerability's authenticity inside a sandbox.
Smart patching: Auto-generate and test patches, pending final confirmation from the developer.
The integration of AI and code auditing has entered the deep waters of "human-machine collaboration." The most effective model today combines the deterministic reliability of traditional SAST tools with the semantic understanding of large language models.
The future of code auditing will increasingly depend on AI Agents capable of autonomous planning, verification, and remediation. While challenges still remain, these agents are steadily reducing the heavy and repetitive workload of security experts, allowing them to focus more on tackling increasingly complex business-logic vulnerabilities.
III. Dangerous Component Detection
3.1 Inspecting pom.xml
3.1.1 Introduction
This file manages: source code, configuration files, developer information and roles, issue tracking systems, organizational information, project licensing, project URLs, project dependencies, and more.
A complete pom.xml file is placed in the root directory of the project.
3.1.2 Secure Component Versions
fastjson secure version:
Requires version 1.2.80 or above
Shiro secure version: 1.8.0
Prior to 1.8.0, when Apache Shiro is used with Spring Boot, a specially crafted HTTP request may lead to authentication bypass.
Prior to 1.7.1, when Apache Shiro is used with Spring, a specially crafted HTTP request may lead to authentication bypass.
Versions prior to 1.7.0 contain an authentication bypass vulnerability; a specially crafted HTTP request may lead to authentication bypass.
Log4j2 secure versions
Java 8 and above: >= 2.17.1
Java 7 and above: >= 2.12.4
Java 6 and above: >= 2.3.2
XStream secure version
1.4.14 or above
🖥️ Web Servers & Proxies
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Nginx
Stable: 1.30.3 or higher Mainline: 1.31.1 or higher
Fixes CVE-2026-9256 and multiple other vulnerabilities
Apache HTTP Server
2.4.68 or higher
Security update released in June 2026
OpenResty
1.29.2.4 or higher
Includes patches for multiple Nginx core CVE vulnerabilities
TongHttpServer (TongTech)
Contact the vendor for security updates
Official security advisory released to address module risk
🗄️ Application Servers
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Apache Tomcat
11.0.24, 10.1.57, or 9.0.120 and higher
Fixes severe vulnerabilities including CVE-2026-59084
Oracle WebLogic
Apply the July 2026 Critical Patch Update (CPU)
Fixes 11 vulnerabilities, including CVE-2026-60206 with a CVSS score of 9.9
JBoss EAP
8.1.6 or higher
Security update released by Red Hat in May 2026
WebSphere
8.5.5.30, 9.0.5.29, or Liberty 26.0.0.8 and higher
Fixes CVE-2026-11594 and multiple other vulnerabilities
WildFly
40.0.1.Final or higher
Released in June 2026 with multiple security updates
Jetty
12.0.31, 12.1.5 or higher
Fixes multiple security vulnerabilities
TongTech TongWeb
Contact the vendor for security updates
Remote code execution vulnerability via deserialization exists
Kingdee Apusic
Contact the vendor for security updates
Official bulletin addresses a JSP source code disclosure vulnerability
BES (Baolande)
Contact the vendor for security updates
Security status must be verified via "version number + patch number"
📨 Messaging Middleware
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Apache ActiveMQ
5.19.8 or 6.2.7 and higher
Fixes CVE-2026-49434 and multiple other vulnerabilities
RabbitMQ
3.13.15, 4.0.20, 4.1.11, 4.2.6, or 4.3.0 and higher
Fixes two authentication bypass vulnerabilities with CVSS scores above 9.0
Apache Kafka
3.9.2, 4.0.2, 4.1.2 or higher
Fixes information disclosure vulnerabilities including CVE-2026-33558
Apache RocketMQ
4.9.6 or 5.1.1 and higher
Fixes multiple security vulnerabilities
💾 Caching & Database Middleware
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Redis
Keep up to date with the latest official stable release (e.g., 7.4.8, 8.6.3)
Fixes remote code execution vulnerabilities including CVE-2026-23631 and CVE-2026-25243
Elasticsearch
8.19.17, 9.3.6, or 9.4.3 and higher
Fixes multiple security vulnerabilities
Apache Cassandra
4.0.20, 4.1.11, or 5.0.7 and higher
Fixes a vulnerability allowing authenticated users to cause denial of service
☁️ Microservices & Cloud Native
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Spring Framework
7.0.8, 6.2.19, 6.1.27, or 5.3.48 and higher
Fixes CVE-2026-41842 (DoS) and multiple other vulnerabilities
Spring Boot
4.0.6, 3.5.16, or 3.4.20 and higher
Fixes CVE-2026-40976 and other vulnerabilities
Spring Cloud
Upgrade per component, e.g., Config 4.2.7
Fixes directory traversal and multiple other vulnerabilities
Apache Dubbo
3.1.11, 3.2.19, or 3.3.6 and higher
Officially recommended most stable versions
Nacos
2.5.3 or 3.2.3 and higher
Released in July 2026 with security dependency upgrades
ZooKeeper
3.8.6 or 3.9.5 and higher
Fixes a vulnerability where reverse DNS spoofing could lead to server/client impersonation
Consul
1.22.5, 1.21.11, 1.18.21, or 2.0.2 and higher
Fixes CVE-2026-2808 and other vulnerabilities
Istio
1.30.0 or higher
Fixes vulnerabilities in security advisories including ISTIO-SECURITY-2026-004
🧩 Development & Integration
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Jenkins
Weekly: 2.551 or higher LTS: 2.541.2 or higher
Fixes a stored XSS vulnerability
GitLab
18.11.7, 19.0.4, or 19.1.2 and higher
Released on July 8, 2026, fixing multiple high, medium, and low severity vulnerabilities
SonarQube
2026.1 LTA or higher
2026 Long Term Support version
Apache Camel
4.14.8, 4.18.3, or 4.21.0 and higher
Fixes CVE-2026-25747 and multiple other vulnerabilities
📚 Common Components & Libraries
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Apache Log4j2
2.25.4 or higher
Fixes CVE-2026-34478 and multiple other vulnerabilities
Fastjson
Immediately upgrade to Fastjson2
Versions 1.2.68 through 1.2.83 contain a remote code execution vulnerability requiring no preconditions
Hibernate
5.3.38 or higher (as well as the latest 6.x versions)
Fixes SQL injection and other vulnerabilities
Apache Struts
6.1.1 or higher
Fixes CVE-2025-68493 (XXE) and multiple other vulnerabilities
🌐 Frontend & Full-Stack Frameworks
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Next.js
15.5.21 (Maintenance LTS) or 16.2.11 (Active LTS) and higher
Fixed 9 security vulnerabilities in July 2026, including SSRF and authorization bypass
React
19.0.4, 19.1.5, 19.2.4 or higher
Fixes DoS and source code disclosure vulnerabilities in React Server Components
Angular
22.0.1, 21.2.17, or 20.3.25 and higher
Fixes CVE-2026-54266 and multiple other XSS vulnerabilities
Vue.js
3.5.34 or higher (Vue 2.x has reached end of support)
All Vue 2.x users are advised to migrate to Vue 3
Django
6.0.6, 5.2.14, or 4.2.30 and higher
Fixes CVE-2026-6873 and multiple other security issues
Laravel
12.60.0 or 13.10.0 and higher
Laravel 11 reached end of security support on March 12, 2026
Play Framework
3.0.11 or higher
Fixes multiple security vulnerabilities in play-ws
🏢 Commercial & Domestic Middleware
For commercial or domestic middleware, version information is often not publicly available. The most reliable approach is to contact the vendor for security updates.
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
F5 BIG-IP
17.1.3.1 or 17.5.1.4 and higher
Fixes multiple security vulnerabilities
TongTech (TongWeb, etc.)
Contact the vendor for security updates
Multiple official security advisories released
Kingdee Apusic (Apusic)
Contact the vendor for security updates
Official vulnerability remediation bulletin released
1. What Is a Code Audit?
A code audit is a systematic examination of software source code aimed at discovering security vulnerabilities, logic flaws, and coding standards violations.
It is the core practice of white-box testing in cybersecurity. Compared to penetration testing (black-box, attacking from the outside), a code audit looks directly under the hood and can uncover deeper, hidden risks.
Core Objectives:
In practice, the typical approach combines automated tooling (SAST scanning) with in-depth manual review.
When to Perform a Code Audit:
Audits are typically conducted before go-live or around major version releases. For systems in finance, government, and internet infrastructure, a code audit is a mandatory compliance “ticket to entry.”
2. The Audit Process
2.1 The Standard Five-Step Audit Process
2.2 Mainstream Audit Tools
2.3 Points to Note
“High-Risk Zones” Beginners Most Easily Overlook
2.4 Deliverables
Typically include a “Vulnerability Risk Classification Table” (Critical/High/Medium/Low), code remediation examples (not always mandatory but expected as standard practice, with a diff comparison), and secure coding guideline recommendations.
2.6 Code Auditing in the Current Market
The integration of AI and code auditing has entered the deep waters of "human-machine collaboration." The most effective model today combines the deterministic reliability of traditional SAST tools with the semantic understanding of large language models.
The future of code auditing will increasingly depend on AI Agents capable of autonomous planning, verification, and remediation. While challenges still remain, these agents are steadily reducing the heavy and repetitive workload of security experts, allowing them to focus more on tackling increasingly complex business-logic vulnerabilities.
III. Dangerous Component Detection
3.1 Inspecting pom.xml
3.1.1 Introduction
3.1.2 Secure Component Versions
fastjson secure version:
Shiro secure version: 1.8.0
Log4j2 secure versions
XStream secure version
🖥️ Web Servers & Proxies
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Nginx
Stable: 1.30.3 or higher
Mainline: 1.31.1 or higher
Fixes CVE-2026-9256 and multiple other vulnerabilities
Apache HTTP Server
2.4.68 or higher
Security update released in June 2026
OpenResty
1.29.2.4 or higher
Includes patches for multiple Nginx core CVE vulnerabilities
TongHttpServer (TongTech)
Contact the vendor for security updates
Official security advisory released to address module risk
🗄️ Application Servers
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Apache Tomcat
11.0.24, 10.1.57, or 9.0.120 and higher
Fixes severe vulnerabilities including CVE-2026-59084
Oracle WebLogic
Apply the July 2026 Critical Patch Update (CPU)
Fixes 11 vulnerabilities, including CVE-2026-60206 with a CVSS score of 9.9
JBoss EAP
8.1.6 or higher
Security update released by Red Hat in May 2026
WebSphere
8.5.5.30, 9.0.5.29, or Liberty 26.0.0.8 and higher
Fixes CVE-2026-11594 and multiple other vulnerabilities
WildFly
40.0.1.Final or higher
Released in June 2026 with multiple security updates
Jetty
12.0.31, 12.1.5 or higher
Fixes multiple security vulnerabilities
TongTech TongWeb
Contact the vendor for security updates
Remote code execution vulnerability via deserialization exists
Kingdee Apusic
Contact the vendor for security updates
Official bulletin addresses a JSP source code disclosure vulnerability
BES (Baolande)
Contact the vendor for security updates
Security status must be verified via "version number + patch number"
📨 Messaging Middleware
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Apache ActiveMQ
5.19.8 or 6.2.7 and higher
Fixes CVE-2026-49434 and multiple other vulnerabilities
RabbitMQ
3.13.15, 4.0.20, 4.1.11, 4.2.6, or 4.3.0 and higher
Fixes two authentication bypass vulnerabilities with CVSS scores above 9.0
Apache Kafka
3.9.2, 4.0.2, 4.1.2 or higher
Fixes information disclosure vulnerabilities including CVE-2026-33558
Apache RocketMQ
4.9.6 or 5.1.1 and higher
Fixes multiple security vulnerabilities
💾 Caching & Database Middleware
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Redis
Keep up to date with the latest official stable release (e.g., 7.4.8, 8.6.3)
Fixes remote code execution vulnerabilities including CVE-2026-23631 and CVE-2026-25243
Elasticsearch
8.19.17, 9.3.6, or 9.4.3 and higher
Fixes multiple security vulnerabilities
Apache Cassandra
4.0.20, 4.1.11, or 5.0.7 and higher
Fixes a vulnerability allowing authenticated users to cause denial of service
☁️ Microservices & Cloud Native
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Spring Framework
7.0.8, 6.2.19, 6.1.27, or 5.3.48 and higher
Fixes CVE-2026-41842 (DoS) and multiple other vulnerabilities
Spring Boot
4.0.6, 3.5.16, or 3.4.20 and higher
Fixes CVE-2026-40976 and other vulnerabilities
Spring Cloud
Upgrade per component, e.g., Config 4.2.7
Fixes directory traversal and multiple other vulnerabilities
Apache Dubbo
3.1.11, 3.2.19, or 3.3.6 and higher
Officially recommended most stable versions
Nacos
2.5.3 or 3.2.3 and higher
Released in July 2026 with security dependency upgrades
ZooKeeper
3.8.6 or 3.9.5 and higher
Fixes a vulnerability where reverse DNS spoofing could lead to server/client impersonation
Consul
1.22.5, 1.21.11, 1.18.21, or 2.0.2 and higher
Fixes CVE-2026-2808 and other vulnerabilities
Istio
1.30.0 or higher
Fixes vulnerabilities in security advisories including ISTIO-SECURITY-2026-004
🧩 Development & Integration
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Jenkins
Weekly: 2.551 or higher
LTS: 2.541.2 or higher
Fixes a stored XSS vulnerability
GitLab
18.11.7, 19.0.4, or 19.1.2 and higher
Released on July 8, 2026, fixing multiple high, medium, and low severity vulnerabilities
SonarQube
2026.1 LTA or higher
2026 Long Term Support version
Apache Camel
4.14.8, 4.18.3, or 4.21.0 and higher
Fixes CVE-2026-25747 and multiple other vulnerabilities
📚 Common Components & Libraries
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Apache Log4j2
2.25.4 or higher
Fixes CVE-2026-34478 and multiple other vulnerabilities
Fastjson
Immediately upgrade to Fastjson2
Versions 1.2.68 through 1.2.83 contain a remote code execution vulnerability requiring no preconditions
Hibernate
5.3.38 or higher (as well as the latest 6.x versions)
Fixes SQL injection and other vulnerabilities
Apache Struts
6.1.1 or higher
Fixes CVE-2025-68493 (XXE) and multiple other vulnerabilities
🌐 Frontend & Full-Stack Frameworks
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
Next.js
15.5.21 (Maintenance LTS) or 16.2.11 (Active LTS) and higher
Fixed 9 security vulnerabilities in July 2026, including SSRF and authorization bypass
React
19.0.4, 19.1.5, 19.2.4 or higher
Fixes DoS and source code disclosure vulnerabilities in React Server Components
Angular
22.0.1, 21.2.17, or 20.3.25 and higher
Fixes CVE-2026-54266 and multiple other XSS vulnerabilities
Vue.js
3.5.34 or higher (Vue 2.x has reached end of support)
All Vue 2.x users are advised to migrate to Vue 3
Django
6.0.6, 5.2.14, or 4.2.30 and higher
Fixes CVE-2026-6873 and multiple other security issues
Laravel
12.60.0 or 13.10.0 and higher
Laravel 11 reached end of security support on March 12, 2026
Play Framework
3.0.11 or higher
Fixes multiple security vulnerabilities in play-ws
🏢 Commercial & Domestic Middleware
For commercial or domestic middleware, version information is often not publicly available. The most reliable approach is to contact the vendor for security updates.
Middleware / Framework
Recommended Secure Version / Mitigation
Reference
F5 BIG-IP
17.1.3.1 or 17.5.1.4 and higher
Fixes multiple security vulnerabilities
TongTech (TongWeb, etc.)
Contact the vendor for security updates
Multiple official security advisories released
Kingdee Apusic (Apusic)
Contact the vendor for security updates
Official vulnerability remediation bulletin released
Baolande (BES)
Contact the vendor for security updates
Remote code execution vulnerability exists; requires patch remediation