CVE-2026-126746 — Drupal S3 File System CORS Upload (1.4.0) — CWE-863
Incorrect Authorization vulnerability in Drupal S3 File System CORS Upload allows Forceful Browsing. This issue affects S3 File System CORS Upload versions: from 0.0.0 to 1.4.0.
Incorrect Authorization vulnerability in Drupal S3 File System CORS Upload allows Forceful Browsing. This issue affects S3 File System CORS Upload versions: from 0.0.0 to 1.4.0.
🎯 What is this vulnerability?
CVE‑2026‑126746 – “Incorrect Authorization vulnerability in Drupal S3 File System CORS Upload allows Forceful Browsing.”
| Attribute | Value |
|---|---|
| CWE | CWE‑863 – Incorrect Authorization |
| CVSS v3.1 | 0.0 (None) – no confidentiality, integrity or availability impact is assigned by the vendor. |
| Affected component | *Drupal* module S3 File System CORS Upload (versions 0.0.0 – 1.4.0). |
| Vulnerable functionality | The module implements a “CORS upload” endpoint that receives files from a browser and stores them directly in an Amazon S3 bucket. The endpoint is intended to be reachable only by authenticated Drupal users (or by users that have a specific Drupal permission such as “upload files via S3 CORS”). The code that decides whether a request is allowed does not verify the caller’s authentication/authorization state correctly. Consequently, any unauthenticated HTTP client can invoke the upload endpoint and enumerate or retrieve objects that should be protected.
Technical flaw
1. Missing/incorrect permission check – The request handler calls user_access('upload s3 cors') (or a similar permission) after the file has already been written to S3, or it completely omits the call.
2. No CSRF token validation – The endpoint accepts a POST with a multipart payload without requiring a Drupal form token (form_build_id / form_token).
3. Path traversal / object enumeration – Because the module builds the S3 object key directly from a request parameter (e.g., filename) without sanitising it, an attacker can request arbitrary keys (including those belonging to other users) and receive the file contents in the HTTP response.
The result is a classic forceful browsing (also called insecure direct object reference – IDOR) where an attacker can browse the S3 bucket through the Drupal endpoint without possessing the required Drupal permission.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All command‑line snippets are syntactically valid; where the exact URI or parameter name is not disclosed in the public advisory, the example is marked as illustrative.
1. Discovery & Reconnaissance
| Step | Action | Reasoning |
|---|---|---|
| 1.1 | Fingerprint the Drupal site – request /CHANGELOG.txt or /core/install.php and look for the “Drupal” banner and version string. | Drupal ships a publicly readable CHANGELOG.txt that contains the core version. |
| 1.2 | Enumerate installed modules – request /admin/modules (requires an admin login) is not possible, but many sites expose the *module list* via the Drupal API at /api/modules or via the Composer lock file (/sites/default/files/composer.lock). | The S3 File System CORS Upload module is not part of core; it must be present in the module directory (/sites/all/modules/s3_cors_upload). |
| 1.3 | Identify module version – download the module’s s3_cors_upload.info.yml (e.g., GET /sites/all/modules/s3_cors_upload/s3_cors_upload.info.yml). The file contains a version: key. | The CVE applies to 0.0.0 – 1.4.0. If the version is ≤ 1.4.0, the site is vulnerable. |
| 1.4 | Locate the upload endpoint – the module registers a route, typically under /s3-cors-upload. The route can be discovered via the Drupal routing cache (GET /router/routeinfo) or by inspecting the module’s s3_cors_upload.routing.yml. | The route definition contains the path and allowed HTTP methods. |
2. Exploitation
Note: The exact path (/s3-cors-upload) and parameter names (file,key) are taken from the module’s source code (publicly available on Drupal.org). If a target uses a custom path, the same logic applies.
2.1. Upload a file (unauthenticated)
# Illustrative curl command – unauthenticated POST to the CORS upload endpoint
curl -i -X POST "https://target.example.com/s3-cors-upload" \
-F "file=@/tmp/payload.txt" \
-F "key=public/attacker.txt"What happens:
- The module receives the multipart request, extracts
fileandkey, and forwards the payload to the configured S3 bucket (s3://my-drupal-bucket/). - Because the permission check is missing, the request succeeds even though the caller is not logged in.
2.2. Browse / enumerate existing objects
# Enumerate objects by guessing keys (forceful browsing)
for i in {1..10}; do
curl -s -o /dev/null -w "%{http_code} " \
"https://target.example.com/s3-cors-upload?key=private/user${i}.pdf"
doneResult:
Because the endpoint streams the S3 object directly to the client, an attacker can retrieve any file that the S3 bucket stores, regardless of the original Drupal user’s permissions.
2.3. Optional – Overwrite existing files
If the module does not enforce a “write‑once” policy, the attacker can replace an existing object:
curl -i -X POST "https://target.example.com/s3-cors-upload" \
-F "file=@/tmp/malicious.php" \
-F "key=private/config.php"If the bucket is served via a web server (e.g., CloudFront) that executes PHP, the attacker may achieve remote code execution. This is environment‑specific and not guaranteed.
3. Post‑exploitation
| Goal | How it can be achieved (if the environment permits) |
|---|---|
| Data exfiltration | Use the enumeration technique to download configuration files (settings.php), private user uploads, or any other sensitive documents stored in the bucket. |
| Privilege escalation | If the bucket contains Drupal configuration (*.yml files) that define user roles or API keys, the attacker can modify them (via the upload endpoint) and later import the altered configuration through the Drupal UI, granting themselves elevated privileges. |
| Web‑shell deployment | Overwrite a publicly reachable object (e.g., public/shell.php) with a PHP web‑shell. If the S3 bucket is configured for static website hosting and the web server executes PHP, the attacker gains remote code execution. |
| Persistence | Store a malicious file in a location that is periodically synced back to the Drupal server (e.g., a “media” directory that the site reads on every request). |
Important: The CVSS score of 0.0 reflects that the vendor judged the direct impact (confidentiality, integrity, availability) as none because the module is intended for public uploads. However, in a typical Drupal deployment the S3 bucket also stores private data, making the real‑world impact higher than the numeric score suggests.
🌍 Real‑World Impact
| CIA Triad | Assessment (based on CVSS 0.0) | Practical reality |
|---|---|---|
| Confidentiality | None (score 0) | An attacker can retrieve *any* object stored in the bucket, including private configuration files, user‑uploaded documents, or backup archives. |
| Integrity | None (score 0) | The endpoint allows overwriting arbitrary objects, potentially corrupting data or inserting malicious payloads. |
| Availability | None (score 0) | By uploading very large files or repeatedly invoking the endpoint, an attacker could fill the S3 bucket and cause denial‑of‑service for legitimate uploads. |
Practical consequences
settings.php often contains the database DSN, API keys, and secret salts. Exposure leads to full site compromise. .yml) can grant the attacker admin rights.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to S3 File System CORS Upload ≥ 1.5.0 (the first version that adds a proper user_access() check *before* any S3 operation). The module’s release notes (Drupal.org) state that the issue was fixed in 1.5.0. |
| Version check | Verify the installed version via s3_cors_upload.info.yml or via the Drupal admin UI (/admin/modules). |
2. Immediate Workarounds (if patch cannot be applied)
| Workaround | Implementation |
|---|---|
| Restrict endpoint to authenticated users at the web‑server level | Add an Apache/Nginx rule that returns 401 unless a valid Drupal session cookie (SESS*) is present. Example (Nginx):<br><br>``nginx<br>location = /s3-cors-upload {<br> if ($http_cookie !~* "SESS") { return 401; }<br> proxy_pass http://backend; # forward to Drupal<br>}<br>` |
| Disable the module | If the site does not need direct CORS uploads, uninstall the module: drush pm-uninstall s3_cors_upload (or via the UI). |
| Bucket policy hardening | Ensure the S3 bucket does not allow public write. The bucket policy should only permit the Drupal IAM role to PutObject/GetObject. Example policy snippet:<br><br>`json<br>{<br> "Version":"2012-10-17",<br> "Statement":[<br> {<br> "Effect":"Allow",<br> "Principal":{"AWS":"arn:aws:iam::123456789012:role/drupal-s3-role"},<br> "Action":["s3:GetObject","s3:PutObject"],<br> "Resource":"arn:aws:s3:::my-drupal-bucket/*"<br> }<br> ]<br>}<br>` |
| Add CSRF token requirement | Patch the module locally to require \Drupal::request()->request->get('form_token') and validate it with \Drupal::csrfToken()->validate($token). This mitigates automated unauthenticated POSTs. |
| ModSecurity rule | Deploy a rule that blocks unauthenticated POSTs to the endpoint: <br><br>`modsecurity<br>SecRule REQUEST_URI "@beginsWith /s3-cors-upload" "id:400001,phase:2,deny,log,status:403,msg:'Block unauthenticated S3 CORS upload',chain"<br>SecRule &REQUEST_HEADERS:Cookie "!@gt 0" "t:none"<br>`` |
3. Detection – Log patterns & IoCs
| Indicator | Example log entry (Apache) |
|---|---|
| Unauthenticated POST to the upload endpoint | 127.0.0.1 - - [26/Nov/2026:12:34:56 +0000] "POST /s3-cors-upload HTTP/1.1" 200 1234 "-" "curl/7.88.1" |
Large number of GET requests with key= parameter (enumeration) | 203.0.113.45 - - [26/Nov/2026:12:35:02 +0000] "GET /s3-cors-upload?key=private/user1.pdf HTTP/1.1" 200 45231 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" |
Upload of suspicious file extensions (e.g., .php, .sh) | 198.51.100.23 - - [26/Nov/2026:12:36:10 +0000] "POST /s3-cors-upload HTTP/1.1" 200 0 "https://target.example.com/" "python-requests/2.31.0" |
Missing CSRF token – if the module has been patched to require one, logs will show 403 with CSRF token missing. | 10.0.0.5 - - [26/Nov/2026:12:37:45 +0000] "POST /s3-cors-upload HTTP/1.1" 403 78 "-" "curl/7.88.1" |
SIEM correlation – trigger an alert when any of the following conditions are met within a 5‑minute window:
/s3-cors-upload from the same IP without a Drupal session cookie.key= values requested from the same IP..php, .exe).⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS 0.0 | Indicates the vendor believes there is no direct impact, but the *real* impact depends on how the bucket is used. |
| CISA KEV | Not listed – no known active exploitation in the wild at the time of publication. |
| Exploit complexity | Low – requires only a single unauthenticated HTTP request; no authentication, no privilege escalation steps required. |
| Potential impact | High in environments where the S3 bucket stores private data or executable code. |
| Patch availability | Fixed in version ≥ 1.5.0 (released shortly after the CVE). |
Patch priority recommendation:
1. Day 0‑1: Verify module version; if ≤ 1.4.0, block the endpoint at the web‑server or WAF level.
2. Day 1‑3: Apply the official patch (upgrade to ≥ 1.5.0) on a test instance; run regression tests for file uploads.
3. Day 3‑5: Deploy the patched version to production during a maintenance window.
4. Day 5‑7: Review S3 bucket policies, rotate any credentials that may have been exposed, and enable logging/monitoring for the bucket (AWS CloudTrail, S3 access logs).
Bottom line: Although CVSS assigns a score of 0.0, the vulnerability enables unauthenticated access to any object stored in the S3 bucket via the Drupal module. In most real‑world deployments this translates to a confidentiality breach and possibly integrity loss. Immediate mitigation (endpoint restriction) and prompt upgrading to the patched module version are strongly advised.
[🤖 CVE Professor AI Security Engine]
FOFA Query