Skip to content

Built-in flag for security.txt detection (e.g., -security-txt) #2468

Closed as not planned

Description

@halilkirazkaya

Please describe your feature request:

I would like to request a dedicated flag (e.g., -security-txt to automatically detect the presence of a valid security.txt file on target hosts.

While it is currently possible to achieve this using -path "/.well-known/security.txt,/security.txt" -mc 200 -ms "Contact:", having a built-in toggle would automate checking the standard paths, validating the HTTP 200 response, and verifying the file contents (such as looking for the Contact: field) to prevent false positives from soft 404s or misconfigured wildcards.

Describe the use case of this feature:

Bug bounty hunters, security analysts, and pentesters routinely check for security.txt files to find responsible disclosure programs and contact information. httpx is almost always the first tool used in the recon pipeline to probe live hosts.

Although nuclei handles this perfectly via templates, bringing this as a quick, native toggle into httpx allows researchers to instantly identify targets with disclosure policies right at the live-host discovery stage. It streamlines workflows and prevents the need to write and maintain long -path, -mc, and -ms flag combinations for such a standard, universally sought-after file.

Activity

  1. added
    Type: Enhancement
    on Apr 6, 2026
  2. self-assigned this
    on Apr 6, 2026
  3. Mzack9999 commented on Apr 22, 2026

    @Mzack9999
    Member

    Hi @halilkirazkaya, thanks for the detailed proposal — the use case is legitimate and well-reasoned. After thinking it through, though, we're going to pass on adding this as a built-in flag. Wanted to share the reasoning since it's a recurring design question for httpx.

    The use case is already a first-class one-liner

    httpx -path "/.well-known/security.txt,/security.txt" -mc 200 -mr "(?m)^Contact:\s*(mailto:|https?://)"

    This isn't a workaround — it's httpx being used exactly as designed. The composable primitives (-path, -mc, -ms, -mr, -mct) exist precisely so users don't need a dedicated flag for every well-known file. Adding -mct text/plain further tightens it against soft-404s and HTML error pages.

    Why we don't want this as a built-in

    1. It would be the first probe flag that's purely a preset of existing flags. The existing convenience flags people often cite as precedent — -favicon/-fhm (mmh3 hashing), -jarm (TLS fingerprint), -tls-probe/-csp-probe (target expansion from TLS SANs / CSP headers) — all do things the composable primitives genuinely cannot express. -security-txt would not, and that's a meaningful line we'd like to keep.

    2. Slippery slope is concrete, not hypothetical. Once -security-txt ships, the same justification applies equally to -robots-txt, -humans-txt, -ads-txt, -sitemap, -manifest, -dnt-policy, -openapi, and so on. We'd either have to keep saying yes (CLI bloat) or say no inconsistently.

    3. Parsing belongs downstream. RFC 9116 has real edge cases — signed security.txt (PGP), Expires validation, multiple Contact: lines, encoding quirks. That parsing logic is a natural fit for nuclei templates or a small post-processing step on httpx's JSON output, not for the prober itself. httpx's job is fast HTTP probing; structured per-format parsing isn't its scope.

    4. Aliases solve this with zero maintenance cost:

      alias httpx-sectxt='httpx -path "/.well-known/security.txt,/security.txt" -mc 200 -mct text/plain -mr "(?m)^Contact:"'

    What we can do instead

    If discoverability is the real pain point, we're happy to accept a docs PR adding a "Common recipes" / "Well-known files" section to the README showing the security.txt one-liner alongside other useful patterns (robots.txt, sitemap, etc.). That way users get the ergonomics without us taking on the maintenance and scope-creep cost.

    Closing as won't-fix on the flag, but very open to a docs contribution. Thanks again for the thoughtful write-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions