Li Jiabao
Display: Static中文 以中文閱讀本頁

Edited by lijiabao.dev

Robots.txt does not lock an admin page: verify access control separately

Separate crawler rules, search indexing, and authorization. Check actual responses for signed-out and different-role users, including APIs and files.

Adding an admin area to a Disallow rule may stop a cooperating crawler from fetching it. It does not establish who may read its data or perform an action. Access control needs to make that decision when the actual request arrives. The examples below describe a hypothetical admin area; they do not describe this site’s administrative setup or report a completed security assessment of any particular website.

A locked filing cabinet and a separate visitor card illustrate different access decisions

Crawler instructions do not authenticate a request

RFC 9309 expressly separates the Robots Exclusion Protocol from access authorization. Publishing a robots.txt file gives cooperating crawlers instructions about fetching resources. It does not add a security check to an admin interface, a downloadable file, or the data behind a page.

The file is normally readable by the public. Listing a path does not make that path secret, and choosing a difficult-to-guess admin address does not replace authorization. The useful question is whether an unauthorized request receives protected content, regardless of how the requester learned the address.

Signing in and having permission are separate decisions

Two people can both be signed in while having different permissions. An ordinary member may be allowed to read a limited set of records, while an administrator can manage a broader set. OWASP distinguishes authorization from authentication and recommends checking applicable permissions on every request.

The implementation may use application sessions, server-level authentication, or another mechanism appropriate to the architecture. First define which identities may access which resources and actions. Then verify that those decisions are enforced. Testing everything in one already authenticated browser session cannot establish what a signed-out visitor or another role would receive.

Protect the data and files as well as the interface

Hiding a button in the browser does not protect its underlying operation. A JavaScript redirect to a login page also cannot prove that the server withheld private data before the redirect. APIs, attachments, exports, and other resources need their own applicable access checks.

Consider a hypothetical site whose admin screen requires a login but whose data endpoint returns a complete record list without one. The visible gate does not cover that endpoint. Within an authorized test scope, identify the resources that are supposed to be private and check each relevant path. A password box on the landing page is insufficient evidence. Prefer necessary read-only checks; do not modify production records merely to demonstrate that a permission exists.

Noindex is an indexing instruction, not a password

Google’s noindex documentation explains that its crawler needs to retrieve the rule to act on it. Blocking a page in robots.txt can prevent the crawler from seeing its noindex instruction. These controls need to be coordinated according to their purpose rather than added as interchangeable layers.

Neither rule prevents an ordinary visitor from reading a publicly accessible page. Use indexing controls for public content that should stay out of search. For private content, establish access protection first. Do not expose confidential material just to let a crawler read a noindex tag. Removing a search result and preventing access to the underlying data require separate evidence.

Compare the same resource under different identities

For your own system, use an environment where you are authorized to test. Compare a signed-out visitor, an ordinary member, and an administrator if those roles match the design. Other systems may need a different set of identities. A browser environment without an existing session helps avoid accidentally carrying administrator privileges into the signed-out check.

Write the expected access decision before reading the actual response. Where members may access only their own records, verify the resource-level boundary rather than only the login screen. Record the resource category, test identity, time, and outcome. Passwords, session cookies, and authorization tokens do not belong in the report.

Inspect the status, redirect, and content together

MDN’s HTTP authentication guide distinguishes requests needing authentication from requests where the supplied identity lacks sufficient permission. Applications may also redirect to a login page or use other responses appropriate to their design. A 200 response alone does not prove a data exposure, and a redirect alone does not prove complete protection.

Check what the final response contains. A public login screen is different from protected records, and the requests supplying those records need to obey the same access policy. Returning private content and subsequently hiding it with styles or client code is different from withholding it on the server. Keep sanitized conclusions from response inspection rather than copying full private payloads into ordinary test logs.

Recheck the boundary when features change

When adding an admin page, API, or export, add the corresponding authorization cases to the checks. Protection on an old entry point does not demonstrate that a new endpoint inherited the same rules. After logout or a permission change, verify subsequent requests according to the session design instead of relying on an earlier successful login.

Keep crawler-rule checks, indexing checks, and access tests as distinct results. They can be maintained together, but evidence for one cannot substitute for another. For a related distinction between machine-readable guidance and enforceable controls, see the site’s guide to llms.txt. To prevent unauthorized data access, examine the server and application’s authorization decisions.

An admin area’s protection is demonstrated by what actual requests can obtain. Crawler preferences describe fetching policy; access control determines which identities can receive data and perform actions.

Sources

  1. RFC 9309 — Robots Exclusion Protocol(external site) rfc-editor.org
  2. Google Search Central — Introduction to robots.txt(external site) developers.google.com
  3. Google Search Central — Block Search indexing with noindex(external site) developers.google.com
  4. MDN — HTTP authentication(external site) developer.mozilla.org
  5. OWASP — Authorization Cheat Sheet(external site) cheatsheetseries.owasp.org