Vulnerable and Outdated Components

senarios cover : CWE-1035, CWE-1329, CWE-1357, CWE-1104, CWE-1395

Unless you are writing a really simple function which doesn’t do much, you will reuse software of other people. From development to deployment, you will use libraries, frameworks, technologies, etc. And guess what! Those third-party components will also depend on other components! This comes at a cost. In fact, part of the third-party software components you will reuse will suffer from security vulnerabilities. Besides, you might even be using some malicious components. Therefore, checking your code is a need, not a luxury. Let’s first understand how attackers find and exploit vulnerable components.

How Attackers Find Vulnerable Components

Step 1: Port Scanning

# Scan all ports and get service versions
nmap -sV -p- target.com

# Fast scanning with Masscan
masscan -p0-65535 target.com --rate=1000

# Efficient scanning with RustScan
rustscan -a target.com -- -sV

Open ports reveal:

  • Apache/Nginx web servers

  • MySQL/PostgreSQL databases

  • Application frameworks

  • Third-party services


Step 2: Fingerprint Technologies

Check HTTP Response Headers:

Automated Fingerprinting Tools:

  • Wappalyzer (browser extension) — Detects frontend and backend technologies

  • BuiltWith (online tool) — Full breakdown of site's technology stack

  • Shodan — Search for specific technologies and versions

Example: Detecting Laravel

Look at HTTP headers and HTML source for Laravel clues:

Check Dependency Files:

If you gain source code access, check:

  • package.json (JavaScript/Node.js)

  • composer.json (PHP)

  • requirements.txt (Python)

  • pom.xml (Java)

  • Gemfile (Ruby)

Example package.json with vulnerable dependencies:

All three are vulnerable versions.


Step 3: Trigger Errors to Reveal Technology Details

Submit malformed input to expose error messages:


Step 4: Forced Browsing — Discover Hidden Files

Find default files and admin panels:

Common targets:

  • /admin, /admin-panel, /administrator

  • /version, /status, /server-info

  • /composer.json (exposes PHP dependencies)

  • /.env (environment variables and secrets)


Step 5: Identify CVEs and Find Exploits

Once you've identified technologies and versions, search for known vulnerabilities:

CVE Databases:

  1. Exploit-DB (exploit-db.com) — Public exploits repository

  2. NVD (nvd.nist.gov) — National Vulnerability Database

  3. MITRE CVE (cve.mitre.org) — Official CVE records

  4. Snyk (snyk.io) — Open-source vulnerability scanning

  5. GitHub Security Advisories — Vulnerabilities in repositories

Example: Finding Apache Struts RCE


Real-World Attack Scenarios

Scenario 1: Prototype Pollution in Lodash (CVE-2018-16487)

A Node.js application uses vulnerable lodash 4.17.5:

The Attack:

Send a JSON payload with prototype pollution:

The vulnerable lodash modifies JavaScript's Object prototype. All objects now have isAdmin: true.

Result:

  • Authentication bypass

  • Authorization escalation

  • Remote code execution

Finding it:


Scenario 2: Unmaintained PHPMailer with RCE (CVE-2016-10033)

PHP application uses PHPMailer 5.2.6 (last update: 2015):

The Attack:

Send a malicious email parameter:

The unmaintained library doesn't sanitize the parameter. It's passed to shell commands unsafely.

Result:

  • Remote code execution

  • Server compromise

  • 8+ years of vulnerability exposure (2015-2023)

Why it's dangerous:

  • Unmaintained means NO security patches

  • Developers don't know it's vulnerable

  • No updates available even if they patch

  • Vulnerability persists indefinitely


Scenario 3: Transitive Dependency Vulnerability (Jackson RCE)

Java application uses Spring Boot 1.5.0:

Spring Boot depends on Jackson 2.8.0, which has CVE-2017-7525: RCE via deserialization.

The Attack:

Send malicious JSON:

Jackson deserializes the @type field, instantiating SpelExpressionParser, which executes arbitrary expressions.

Result:

  • Remote code execution

  • Complete server compromise

  • Vulnerability hidden in transitive dependency

Finding it:


Scenario 4: Log4Shell (CVE-2021-44228)

Java application uses Apache Log4j 2.14.0:

The Attack:

Send a specially crafted string that triggers JNDI injection:

Result:

  • Remote code execution

  • Affects billions of devices worldwide

  • One of the most critical vulnerabilities ever

Real-world impact:

  • SolarWinds, Apple, Twitter, Cloudflare compromised

  • Critical infrastructure vulnerable

  • Estimated billions of devices affected

Finding it:


Scenario 5: Typosquatting Attack (python3-dateutil)

Attacker creates malicious package python3-dateutil (real package: python-dateutil):

The Attack:

  1. Attacker publishes python3-dateutil to PyPI with malicious code

  2. Developer typos the package name: pip install python3-dateutil

  3. Instead of legitimate package, installs attacker's code

  4. Malicious code exfiltrates SSH keys and credentials

Result:

  • Backdoor in developer's environment

  • Credentials stolen

  • Projects compromised

  • Supply chain attack

Real incident:

  • Hundreds of developers downloaded the malicious package

  • SSH keys exfiltrated to attacker server

  • Complete compromise of developer accounts

Finding it:


Scenario 6: XStream Deserialization RCE

Java application uses XStream 1.4.5 for XML parsing:

The Attack:

Send malicious XML payload:

XStream deserializes this as ProcessBuilder, executing arbitrary commands.

Result:

  • Remote code execution

  • File system access

  • Complete server compromise

Finding it:


Scenario 7: Dependency Confusion Attack

Organization uses internal package @company-utils in private Maven repository. Attacker publishes company-utils version 2.0.0 to public Maven Central.

The Attack:

  1. Build system configured to check public repos first

  2. Attacker publishes company-utils:2.0.0 to Maven Central with malicious code

  3. Build system finds public version before private version

  4. Malicious version downloaded and built into application

  5. Application ships with attacker's backdoor

Result:

  • Backdoor in production

  • Supply chain compromise

  • All customers affected

Finding it:


How to Identify Vulnerable Components During Testing

1. List all dependencies and their versions:

2. Scan for known vulnerabilities:

3. Check for outdated/unmaintained packages:

4. Review dependency files:

Look for ancient versions:

5. Check transitive dependencies:


Advanced Hunting Techniques

Use Nuclei for Automated Detection

Create a Nuclei template to detect outdated software:

Run it:

Automated Scanning with CI/CD


Mitigation Strategies

1. Inventory all dependencies

Know what you're using:

2. Update proactively

3. Monitor for vulnerabilities continuously

  • Snyk — Continuous monitoring and automated PRs for fixes

  • Dependabot — GitHub's dependency update automation

  • WhiteSource — Enterprise scanning

  • Black Duck — Comprehensive scanning

4. Lock dependency versions

5. Use only trusted sources

  • Verify package authenticity

  • Use official package managers

  • Check package integrity

  • Review maintainer reputation

6. Remove unused dependencies

7. Implement policies

  • No unmaintained packages

  • Max age for packages without updates

  • Mandatory security scanning

  • Quarterly dependency audits

  • Prevent transitive dependency exploits

8. Patch vulnerable components immediately

Especially for:

  • RCE vulnerabilities

  • Authentication bypass

  • Data exposure

  • Critical libraries (logging, JSON parsing, etc.)


Last updated