How to fix: Sitemap.xml publicly accessible
sitemap.xml is publicly accessible or referenced in the page. While a sitemap is designed to help search engines index public content, it may inadvertently list admin paths, internal tools, or staging URLs that were not intended for public visibility.
Why it matters
A sitemap intended for search engines may expose admin paths, internal API routes, staging URLs, or paginated content trees. Attackers can use sitemap.xml as a ready-made map of the application's endpoint structure, skipping the need for active crawling or brute-force discovery.
Sitemaps are meant to list pages you want indexed. Problems arise when the sitemap is generated automatically from all routes without filtering, including paths like /admin, /internal, or /_debug that should not be publicly listed.
How to fix it
- 1Audit sitemap.xml to confirm it lists only pages intended for public indexing.
- 2Exclude admin, internal, debug, and API routes from sitemap generation.
- 3Use robots.txt Disallow rules alongside sitemap to signal crawler scope.
- 4For Next.js, configure the sitemap generator to exclude protected paths.
Code examples
Next.js (next-sitemap.config.js)
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || 'https://example.com',
generateRobotsTxt: true,
exclude: [
'/admin',
'/admin/*',
'/api/*',
'/_debug',
'/internal/*',
],
};robots.txt (pair with sitemap)
User-agent: *
Disallow: /admin/
Disallow: /api/
Disallow: /internal/
Sitemap: https://example.com/sitemap.xmlReferences
- https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview
- https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/01-Information_Gathering/03-Review_Webserver_Metafiles_for_Information_Leakage
- https://cwe.mitre.org/data/definitions/200.html
Detected automatically by VulnRadar. The check id is sitemap-public, stable across every scan so you can filter or diff on it.
More info disclosure checks
- MediumRails Session Cookie Missing HttpOnly Flag
- InfoServer header truncated
- InfoPHP session cookie naming exposes runtime
- Infoconfig.js / settings.js referenced (verify contents)
- Infoenv.js / environment.js referenced (verify contents)
- InfoOpenAPI schema version exposed in URL
- LowCORS exposes internal CDN hostname
- InforeCAPTCHA site key exposure
Questions
- How severe is Sitemap.xml publicly accessible?
- VulnRadar rates this info severity in the info disclosure 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 sitemap-public, which stays the same between runs so you can filter, diff, or gate CI on it.
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.