Skip to content
Access control Write-up Beginner

Exposed Endpoints Lead To Leak PII

The /folders and /files endpoints of a Directus CMS API returned data without proper authentication, exposing file metadata, internal folder structure, user identifiers, email addresses and full names. An attacker could enumerate users and map the internal CMS structure, enabling targeted phishing or further attacks.

1sherlok Follow

Published on medium.com

Hello everyone, I’m Sherlok, and today I’d like to share a story about how I discovered exposed endpoints in an API that led to a leak of PII and the internal folder structure.

1sherlok, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the backend failed to properly validate authentication and authorization for the /folders and /files endpoints, accepting invalid tokens and not checking permissions.

Impact

An attacker could enumerate users via exposed email addresses, map the internal CMS structure, gather metadata for further attacks, and perform targeted phishing or social engineering; no authentication was required.

What the attacker needed

None

The fix

The backend should restrict /folders and /files to authorized users, validate all authentication tokens correctly, return 401 or 403 for invalid or missing credentials, review CMS role permissions, and remove sensitive data like email addresses from metadata where possible.

How it was found

  1. Send a GET request to the root path and observe a message suggesting a redirect to /admin.
  2. Test common Directus endpoints such as /items, /files and /folders.
  3. Notice that most endpoints return 403 Forbidden without authentication.
  4. Request /folders and /files and observe they return 200 OK with actual data.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

An API is a way for programs to talk to each other. Some parts of this API, which should only be available to logged-in staff, were open to anyone. That meant a stranger could ask for lists of files and folders and get back private details like people's names and email addresses.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by 1sherlok

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.