Skip to main content
LowSupply chainOWASP A05:2021CWE-540

How to fix: Maven pom.xml exposed

The response is a Maven project object model: a modelVersion of 4.0.0 together with artifact coordinates.

Why it matters

A pom names every direct dependency with its version, the build plugins and their configuration, and the repositories the build resolves against. Internal Nexus or Artifactory URLs appear in the repositories section, and profile blocks routinely carry environment-specific server names. It also states the application's own groupId and version, which pins down exactly which release is deployed.

A served pom is nearly always a Java web application deployed as an exploded directory with the project sources still present, which usually means other build files are reachable too. Worth checking the same paths for settings.xml, which can contain repository credentials.

How to fix it

  1. 1Deploy the packaged artifact rather than the project directory, so build files are not present under the document root.
  2. 2Deny pom.xml, settings.xml and any *.gradle path at the web server.
  3. 3Verify settings.xml is not also reachable, since it may hold repository credentials.
  4. 4Audit the declared dependency versions now that they are public.

Code examples

Tomcat: refuse to serve build files

XML
<security-constraint>
  <web-resource-collection>
    <web-resource-name>Build files</web-resource-name>
    <url-pattern>/pom.xml</url-pattern>
    <url-pattern>/settings.xml</url-pattern>
  </web-resource-collection>
  <auth-constraint/>
</security-constraint>

Audit the declared tree

bash
mvn org.owasp:dependency-check-maven:check

References

Detected automatically by VulnRadar. The check id is supply-chain-maven-pom-exposed, stable across every scan so you can filter or diff on it.

See every supply chain check

Questions

How severe is Maven pom.xml exposed?
VulnRadar rates this low severity in the supply chain 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 supply-chain-maven-pom-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Maven pom.xml exposed 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 maven pom.xml exposed

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: Maven pom.xml exposed | VulnRadar