Skip to main content
LowAPIOWASP A05:2021CWE-540

How to fix: RAML API definition publicly served

A RAML API definition is served from this URL, identified by the #%RAML version marker. RAML files must begin with that marker, so this matches the document itself rather than a mention of it.

Why it matters

A RAML file lists every resource and method the API defines, the parameters each takes, and the securedBy scheme applied to each one, including operations that are not referenced by any public client.

RAML documents normally live in a design repository or an API portal, not on the runtime origin. Finding one served from the application host usually means the whole design directory was copied into the deployment. The security value to an attacker is the same as any complete interface description: it removes the guessing from finding an endpoint whose authorization was never implemented.

How to fix it

  1. 1Remove the RAML file and its includes from the served origin.
  2. 2Publish the definition to an internal API portal or a design workspace instead.
  3. 3Review any resource the file exposed that you did not expect to be public, and confirm it enforces authorization.

Code examples

Find RAML files in the deployed output

bash
grep -rl '^#%RAML' dist public build 2>/dev/null

References

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

See every api check

Questions

How severe is RAML API definition publicly served?
VulnRadar rates this low 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-raml-document-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does RAML API definition 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 raml api definition 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

How to fix: RAML API definition publicly served | VulnRadar