Mar 24, 2026·6 min read·18 visits
A glob injection vulnerability in Rails Active Storage DiskService allows attackers who can control file prefixes to delete arbitrary files within the storage root directory.
CVE-2026-33202 is a Medium severity vulnerability in the Ruby on Rails Active Storage component (DiskService). It permits attackers to perform glob injection attacks due to improper neutralization of metacharacters, potentially leading to unauthorized deletion of arbitrary files within the storage directory.
Active Storage is a core framework within Ruby on Rails designed to facilitate uploading files to cloud storage services and local filesystems. It handles attaching files to Active Record objects and managing file transformations, such as image resizing or thumbnail generation. The DiskService component specifically manages files stored on the local filesystem of the application server.
CVE-2026-33202 is classified as a Glob Injection vulnerability (CWE-74) within the ActiveStorage::Service::DiskService module. The vulnerability arises from improper neutralization of user-controllable input before passing it to a file path pattern matching function. This failure allows attackers to manipulate the pattern matching logic.
The primary consequence of this vulnerability is unauthorized data deletion. An attacker who can influence the prefix string used during variant deletion can force the application to recursively delete unintended files within the active storage directory. The vulnerability requires no authentication and can be exploited remotely over the network.
The vulnerability originates in the delete_prefixed method of the ActiveStorage::Service::DiskService class. This method is responsible for removing a primary blob and all its associated derivative files (variants) from the local filesystem. It achieves this by taking a file prefix, appending a wildcard, and passing the result to Ruby's Dir.glob method.
Ruby's Dir.glob function evaluates specific characters as metacharacters for pattern matching. These include * (match any string), ? (match any single character), [set] (match characters in a set), {p,q} (match literal strings), and \ (escape character). In the vulnerable implementation, the application does not sanitize the prefix argument before passing it to Dir.glob.
Because the prefix variable is concatenated directly with a wildcard (#{prefix}*) and passed to Dir.glob, any metacharacters injected into the prefix are evaluated by the glob engine. The resulting matched paths are subsequently iterated over and passed to FileUtils.rm_rf(path), which recursively force-deletes the files and directories.
The vulnerable code path is straightforward. The delete_prefixed method accepts a prefix argument, constructs a pattern using string interpolation, and iterates over the matches to delete them.
# Vulnerable implementation in DiskService
def delete_prefixed(prefix)
instrument :delete_prefixed, prefix: prefix do
Dir.glob(path_for("#{prefix}*")).each do |path|
FileUtils.rm_rf(path)
end
end
endThe fix, introduced in commit 8c9676b803820110548cdb7523800db43bc6874c, addresses the vulnerability through explicit metacharacter escaping. The patch introduces a new private method, escape_glob_metacharacters, which identifies and escapes all characters treated specially by Dir.glob.
# Patch addition
def escape_glob_metacharacters(path)
path.gsub(/[\[\]*?{}\\]/) { |c| "\\#{c}" }
endThe patched delete_prefixed method now normalizes the path, manually restores trailing slashes stripped by path resolution, escapes the glob metacharacters, and only then appends the intended wildcard.
# Patched implementation in DiskService
def delete_prefixed(prefix)
instrument :delete_prefixed, prefix: prefix do
prefix_path = path_for(prefix)
prefix_path += "/" if prefix.end_with?("/")
escaped = escape_glob_metacharacters(prefix_path)
Dir.glob("#{escaped}*").each do |path|
FileUtils.rm_rf(path)
end
end
endThis fix is assessed as complete. By utilizing a regular expression to target the exact set of metacharacters supported by Ruby's Dir.glob engine and prefixing them with a backslash, the patch prevents the glob engine from interpreting attacker-supplied characters as operational logic.
Exploitation requires the target application to accept user-controlled input that influences the blob key or prefix passed to the DiskService#delete_prefixed method. If the application uses direct user input to define custom blob keys or constructs prefixes without secondary validation, it is vulnerable.
An attacker can craft a specific file upload or API request where the assigned file key is a glob metacharacter string, such as *. When the application invokes the deletion routine for this specific blob or its variants, the DiskService executes Dir.glob against /storage_root/path/*.
The resulting operation passes every file and directory within the storage root to FileUtils.rm_rf. This results in the complete deletion of all active storage data on the local filesystem.
More granular attacks are possible depending on the attacker's knowledge of the file structure. Supplying [a-z]* targets only specific ranges of files, while ** triggers recursive deletion across nested subdirectories. The execution sequence is illustrated in the diagram below:
The vulnerability carries a CVSS 4.0 score of 6.6, mapping to a Medium severity rating. The primary driver of this score is the High Vulnerability Integrity (VI:H) metric. The attack explicitly results in data destruction by deleting files outside the authorized scope of the intended operation.
While the integrity impact is high, the vulnerability does not directly provide a path to remote code execution (RCE) or information disclosure (VC:N). The deletion scope is generally restricted to the Active Storage root directory, as the path_for method normalizes paths and resolves directory traversal attempts before the glob pattern is executed.
As of the disclosure date, the Exploit Maturity is rated as Unproven (E:U). No weaponized exploits or public proof-of-concept codes are known to be actively circulating or in use by threat actors. However, due to the low attack complexity (AC:L), developing a functional exploit is trivial if the target application's business logic exposes the vulnerable parameter.
The primary remediation strategy is to upgrade the activestorage gem to a patched version. The Rails security team has released patches across three active release branches. Organizations using Rails 8.1 should upgrade to 8.1.2.1, Rails 8.0 users should upgrade to 8.0.4.1, and Rails 7.2 users should upgrade to 7.2.3.1.
If immediate patching is not technically feasible, developers must implement strict input validation on all parameters that influence Active Storage file keys or prefixes. This validation should enforce an allowlist approach, permitting only alphanumeric characters and rejecting any input containing glob metacharacters (*, ?, [, ], {, }, \).
Security teams should monitor application logs for anomalous file deletion requests, particularly those containing asterisks or brackets in the file key parameters. Deploying file integrity monitoring (FIM) on the Active Storage root directory can also provide rapid detection if unauthorized data deletion occurs.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:U| Product | Affected Versions | Fixed Version |
|---|---|---|
Active Storage (Rails) Ruby on Rails | >= 8.1.0.beta1, < 8.1.2.1 | 8.1.2.1 |
Active Storage (Rails) Ruby on Rails | >= 8.0.0.beta1, < 8.0.4.1 | 8.0.4.1 |
Active Storage (Rails) Ruby on Rails | < 7.2.3.1 | 7.2.3.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-74 (Glob Injection) |
| Attack Vector | Network |
| CVSS v4.0 Score | 6.6 (Medium) |
| Primary Impact | Arbitrary File Deletion (High Integrity Loss) |
| Exploit Status | Unproven / No Active Exploitation |
| CISA KEV | Not Listed |
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or routed.
Code16 Sharp versions from 9.0.0 up to (but not including) 9.22.3 are vulnerable to a missing authorization flaw in the Quick Creation Command feature. The ApiEntityListQuickCreationCommandController fails to validate entity-level 'create' policies before returning administrative form designs or processing database modifications. Authenticated users with restricted access can bypass policy boundaries to access creation configurations and insert records.
CVE-2026-49471 is a high-severity security vulnerability in Serena, an AI-assisted coding Model Context Protocol (MCP) toolkit. In versions prior to v1.5.2, Serena's built-in web dashboard exposes an unauthenticated Flask API on a predictable port. Lacking host validation and CSRF protections, this endpoint is vulnerable to DNS Rebinding. An attacker can lure a user to a malicious webpage, bypass the Same-Origin Policy (SOP), rewrite the AI agent's persistent memory, and execute arbitrary commands on the host operating system via the autonomous agent's shell execution engine.
The trapster honeypot package is vulnerable to a remote denial of service (DoS) vulnerability due to uncontrolled recursion during the parsing of malformed DNS compression pointers in the decode_labels function.
A critical Use-After-Free (UAF) memory corruption vulnerability exists in the oneringbuf Rust crate prior to version 0.8.0. The vulnerability allows safe Rust code to instantiate and clone reference wrappers that point to heap-allocated ring buffers. Dropping one wrapper prematurely reclaims the backing memory, leading to dangling pointer references and subsequent Use-After-Free or Double Free states.
Januscape (CVE-2026-53359) is a critical Use-After-Free vulnerability in the x86 Shadow MMU component of the Linux Kernel's KVM subsystem. A logic error in shadow page tracking permits unauthorized page reuse without validating architectural execution roles, leading to dangling pointers in reverse mapping (rmap) tracking entries during guest memory teardown.
CVE-2026-48282 is a critical unauthenticated path traversal and arbitrary file write vulnerability in the Remote Development Services (RDS) component of Adobe ColdFusion. The vulnerability allows a remote, unauthenticated attacker to bypass directory boundaries and write arbitrary files, including CFML-based web shells, onto the host server. This flaw is actively exploited in the wild and enables full unauthenticated remote code execution under the privileges of the ColdFusion service account.