You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Built-in flag for security.txt detection (e.g., -security-txt) #2468
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.
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.
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
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.
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.
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.
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.
Activity
Mzack9999 commentedon Apr 22, 2026
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
This isn't a workaround — it's
httpxbeing 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/plainfurther tightens it against soft-404s and HTML error pages.Why we don't want this as a built-in
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-txtwould not, and that's a meaningful line we'd like to keep.Slippery slope is concrete, not hypothetical. Once
-security-txtships, 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.Parsing belongs downstream. RFC 9116 has real edge cases — signed security.txt (PGP),
Expiresvalidation, multipleContact:lines, encoding quirks. That parsing logic is a natural fit fornucleitemplates 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.Aliases solve this with zero maintenance cost:
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.
docs: add Common Recipes section for well-known files (#2527)