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
- 1Remove the RAML file and its includes from the served origin.
- 2Publish the definition to an internal API portal or a design workspace instead.
- 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
grep -rl '^#%RAML' dist public build 2>/dev/nullReferences
Detected automatically by VulnRadar. The check id is api-raml-document-exposed, stable across every scan so you can filter or diff on it.
More api checks
- LowTRACE method referenced in API response body
- InfoREST endpoint allows DELETE
- LowGraphQL introspection field suggestions
- MediumGraphQL endpoint has no rate-limit headers
- LowOpenAPI server URL leaks internal host
- LowCORS preflight result not cached
- HighBearer token in URL query string
- MediumJSONP callback parameter accepted
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.