Lab 06: OWASP A06 — Vulnerable and Outdated Components

Objective

Identify and exploit vulnerable software components on a live server from Kali Linux: extract component version information, cross-reference against CVE databases, exploit pickle deserialization for Remote Code Execution, demonstrate YAML arbitrary code execution (CVE-2020-1747), generate a Software Bill of Materials (SBOM), and perform dependency auditing — then implement a secure supply chain workflow.

Background

Vulnerable Components is OWASP #6 (2021). The 2021 Log4Shell (CVE-2021-44228) affected millions of servers and was exploitable with a single HTTP header. The 2017 Equifax breach (147 million records) exploited Apache Struts CVE-2017-5638 — a publicly-known vulnerability with a patch available for 2 months before the attack. Both were preventable by keeping dependencies updated. Modern apps average 80+ third-party dependencies; each is a potential attack surface.

Architecture

┌─────────────────────┐        Docker Network: lab-a06         ┌─────────────────────┐
│   KALI ATTACKER     │ ─────── HTTP attacks ─────────────▶   │   VICTIM SERVER     │
│  innozverse-kali    │                                         │  innozverse-cybersec│
│  curl, python3,     │ ◀────── responses ───────────────────  │  Flask :5000        │
│  nikto              │                                         │  (outdated deps,   │
└─────────────────────┘                                         │   pickle endpoint)  │
                                                                └─────────────────────┘

Time

35 minutes

Tools

  • Victim: zchencow/innozverse-cybersec:latest

  • Attacker: zchencow/innozverse-kali:latest


Lab Instructions

Step 1: Environment Setup


Step 2: Launch Kali + Recon


Step 3: Extract Component Versions

📸 Verified Output:


Step 4: CVE Cross-Reference

📸 Verified Output:

💡 Every outdated dependency is a known, published attack path. Attackers run automated scanners that fingerprint component versions in HTTP headers, error messages, and endpoints like this one, then match against CVE databases. Tools like pip audit, npm audit, trivy, and snyk can do this for you automatically in CI/CD.


Step 5: Pickle Deserialization — Remote Code Execution

📸 Verified Output:

💡 Python's pickle module is inherently unsafe for untrusted input. The __reduce__ method tells Python how to reconstruct an object — and it can execute any Python code. There is no safe way to deserialise arbitrary pickle data. Use JSON, MessagePack, or Protocol Buffers for data exchange. If you must deserialise Python objects, use jsonpickle with strict type allowlisting.


Step 6: Nikto Web Scanner

📸 Verified Output:


Step 7: Dependency Audit Workflow

Step 8: Cleanup


Remediation

Issue
Risk
Fix

Outdated Flask/Jinja2/Werkzeug

Known CVEs

pip install --upgrade flask jinja2 werkzeug

Pickle endpoint

RCE

Never deserialize pickle from untrusted input; use JSON

Version disclosure

Reconnaissance

Remove /api/versions; don't expose Server headers

No dependency audit

Unknown vulnerabilities

pip audit in CI/CD; Dependabot/Renovate for auto PRs

Summary

Attack
Tool
Result

Version extraction

curl

8 outdated components identified

CVE lookup

python3

9 CVEs found including CRITICAL (PyYAML RCE)

Pickle RCE

python3

OS command executed as root

Web scan

nikto

Missing headers + version disclosure

Audit

pip audit (simulated)

All packages need updates

Further Reading

Last updated