Skip to main content
MediumAPIOWASP A05:2021CWE-540

How to fix: Postman collection export publicly served

A Postman collection export is served from this URL, identified by its own _postman_id field. Collections carry every request path, body and header the author saved.

Why it matters

A collection is a saved copy of how someone actually called the API: every path, every request body, every header. Collections routinely carry the values used while testing, so the file frequently contains a live bearer token, an API key, or a basic-auth credential in the auth block or in a saved variable, and it always contains internal routes that were never linked publicly.

These usually reach the web root by accident: a developer exports a collection into the repository to share it, and the whole repository ends up in the build output. The immediate question is not whether the file should be there, it is whether anything in it is still valid. Treat every credential and every internal hostname it contains as disclosed.

How to fix it

  1. 1Remove the file from the served origin and from the repository history if it carried credentials.
  2. 2Rotate every token, key, and password that appears anywhere in the collection or its environment file.
  3. 3Share collections through a Postman workspace or a private link rather than a checked-in export.
  4. 4Add *.postman_collection.json and *.postman_environment.json to .gitignore.

Code examples

Find and exclude collection exports

bash
find . -name '*postman_collection.json' -o -name '*postman_environment.json'

cat >> .gitignore <<'EOF'
*.postman_collection.json
*.postman_environment.json
EOF

References

Detected automatically by VulnRadar. The check id is api-postman-collection-exposed, stable across every scan so you can filter or diff on it.

See every api check

Questions

How severe is Postman collection export publicly served?
VulnRadar rates this medium severity in the api category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id api-postman-collection-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Postman collection export publicly served map to?
It maps to CWE-540. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for postman collection export publicly served

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Postman collection export publicly served fix | VulnRadar