RoastMyOpsec

Vulnerabilities

robots.txt Disallow vs Access Control for Hidden Paths

August 4, 2025

robots.txt Disallow vs access control is a control-plane mismatch that shows up constantly on marketing sites. Disallow tells well-behaved crawlers not to fetch a path. It does not authenticate users, it does not block attackers, and it often publishes a list of admin, backup, or staging URLs. Real protection is auth, network allowlists, and edge deny rules. RoastMyOpsec fetches /robots.txt and reads Disallow lines; it does not crawl those paths. Juicy Disallows are a disclosure finding, not a proof of compromise.

The practical difference

robots.txt is a politeness file for crawlers. Search engines that honor it will skip listed paths. Security scanners, browsers, and people will not.

Access control is a decision on the request: 401, 403, SSO, VPN, or a WAF rule. The path can be guessable and still be safe if the control holds.

How to choose what belongs in robots.txt

Put crawl budget and duplicate-content paths in robots.txt: faceted search junk, infinite calendars, internal search result pages. Do not put /admin, /backup.zip, /.env, or tokenized preview URLs there.

If a path must stay out of Google, noindex plus authentication is stronger than Disallow alone. Disallow can even prevent Google from seeing a noindex tag on that URL.

Goalrobots.txtAccess controlTakeaway
Keep a URL out of searchSometimes, for crawl wasteDoes not replace noindex/authUse robots for budget, not secrecy
Stop strangers reading a fileDoes nothingRequiredDeny at origin or CDN
Hide an admin panelAdvertises it if DisallowedSSO, MFA, VPN, rate limitsGuessing is not the main risk — login is
Preview deploymentsDo not list secret slugsAuth or IP allowlistUnlisted URLs still leak via Referer and chats

When robots.txt becomes a treasure map

A Disallow for /admin, /internal, /old, /phpmyadmin, or /backup is a tour guide. RoastMyOpsec calls that out because security-through-obscurity fails harder when you publish the map.

A missing robots.txt is usually not critical. A chatty one is worse than a boring one.

Common mistakes

The first mistake is Disallow: /secret/ and no auth on /secret/.

The second mistake is putting API keys or signed URLs in sitemap.xml.

The third mistake is blocking CSS/JS in robots and wondering why the site renders poorly in search previews.

Free audit the URL you own

RoastMyOpsec is a defensive public-surface roast: headers, cookies, sensitive paths, and more — no exploit payloads. Start with the free audit, then open the vault if the blurred findings look expensive.

Free audit now

FAQ

Does Disallow in robots.txt hide a page from attackers?
No. It only advises crawlers. Anyone can still request the URL. Use authentication or edge deny rules.
Should I Disallow /admin?
You can, but it does not protect /admin, and it advertises the path. Protect the panel with SSO and MFA; keep robots mundane.
Is a missing robots.txt a vulnerability?
Usually no. It is a crawler-guidance gap. Chatty Disallow lists are the OPSEC problem.

Sources

Related guides