Command Shell in Externally Accessible Directory

Incomplete Variant
Structure: Simple
Description

This vulnerability occurs when a command shell script is placed in a web-accessible directory, such as /cgi-bin/. Attackers can directly request this file to execute arbitrary commands on the server, leading to full system compromise.

Extended Description

Web servers are designed to serve specific file types, like HTML or images, and to execute authorized scripts in controlled ways. When a shell script (e.g., a .sh or .bat file) is mistakenly uploaded or created in a publicly accessible folder, it bypasses these normal application controls. An attacker can simply trigger the script via a web request, causing the server to run any commands embedded within it with the web server's permissions. To prevent this, enforce strict inventory controls for all files in web directories. Development and deployment processes should never place interpreter shells or administrative scripts within the document root or other accessible locations. Regularly audit these directories for unauthorized files, and configure web server rules to block execution of known script extensions in static content areas.

Common Consequences 1
Scope: ConfidentialityIntegrityAvailability

Impact: Execute Unauthorized Code or Commands

Potential Mitigations 1
Phase: InstallationSystem Configuration
Remove any Shells accessible under the web root folder and children directories.
Modes of Introduction
Implementation
Operation