Use this when reviewing source code for security flaws.
Code Review
Security code review examines source code, manually and with SAST tools, for flaws like injection, broken access control, insecure crypto and hard-coded secrets before release.
1. Code review finds security bugs before release.
2. SAST in CI plus human review of risky changes.
3. Focus on auth, input handling, crypto, secrets.
4. Track findings by CWE.
5. Train developers.
code change → SAST + peer review → fixes → merge
Context & applicabilityCommon mistakes · platform/version boundaries
- Reviewing only the diff, missing how the change interacts with existing code.
- SAST findings ignored because of false positives — tune rules instead.
- No security checklist for reviewers.
- Large pull requests that are impossible to review properly.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Combine manual review and SAST.
- Focus on input, auth and crypto.
- Review before release.
semgrep --config auto .— SAST- Peer review checklist for security — manual review
- Secure coding standard — reference
ReferenceWhy it matters1 section · depth on demand
Combining manual and automated review
| Method | Finds |
|---|---|
| SAST (Semgrep, CodeQL, SonarQube) | Injection, unsafe APIs, hard-coded secrets |
| SCA (Dependabot, Snyk, OWASP Dependency-Check) | Vulnerable libraries |
| Secret scanning | Keys and tokens |
| Manual review | Authorisation logic, business logic, crypto misuse |
Focus manual review on authentication, authorisation, input handling and new security-relevant code. Run SAST in CI and block on high-severity findings.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Security code review examines source code for vulnerabilities — injection, broken access control, unsafe deserialisation, hard-coded secrets, weak cryptography — before it reaches production. Fixing flaws in code is far cheaper than after deployment.
| Method | Strength |
|---|---|
| Manual review | Finds logic and authorisation flaws |
| SAST (static analysis) | Scales across code; finds known patterns (Semgrep, SonarQube, CodeQL) |
| Secret scanning | Finds committed credentials |
| Dependency/SCA scanning | Vulnerable libraries |
Integrate automated tools into pull requests, focus manual review on security-sensitive areas (authentication, authorisation, input handling, crypto), and use checklists such as OWASP ASVS and the Code Review Guide.
What to focus on
- Authentication and authorisation checks on every endpoint.
- Input handling at trust boundaries (SQL, shell, file paths, deserialization).
- Cryptography use and secret handling.
- Error handling and logging (no sensitive data in logs).
- Third-party dependencies and their versions.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Security Testing → Code Review. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/sp/800/115/final · confidence 94%