Repository navigation
Description
Goal
- No secret (a peer authentication key, a REST API admin token, a database credential) is held by an error value, printed by an error message, or written to a log line or other output.
- Text sent to a client of the HTTP tracker, the UDP tracker or the REST API is friendly and relevant, and gives an attacker nothing about the implementation (database driver text, nested internal error names, server timing values).
Why
The review of the pull request for #2916 found that authentication::key::Error::UnableToReadKey keeps the peer key and prints it in the HTTP failure reason. An inventory of the tree then found more cases: the HTTP tracker and the REST API log each request URI at INFO, so the peer key (/announce/<key>) and the admin token (?token=<token>) are written to the log; a generated key is logged at DEBUG; PeerKeyError::InvalidKey echoes an uploaded key; the REST client puts the token in the query string, and its transport errors print the URL; a configuration error prints the offending value, so a numeric password or token is printed. Client replies also carry database driver text (UNIQUE constraint failed: keys.key), nested internal wording, the server clock (UDP connection cookie errors) and a Rust type name (UDP parse errors).
Maintainer decisions (2026-11-22)
- An EPIC with two sub-issues: the first is a bug class with listed cases, the second a design question that needs an ADR.
- Request-URI logging is in scope: redact the peer key and the
tokenquery parameter in both servers. - Standalone: linked from EPIC EPIC: Remove source locations from errors #2912 and Remove source locations from the errors of torrust-tracker-core #2916, not a sub-issue of EPIC: Remove source locations from errors #2912, which keeps its single scope (source locations).
- What a client receives for database failures is decided in the ADR of the second sub-issue.
- Principle: help the legitimate user as much as possible without revealing the secret. Security does not rely on hiding how the tracker works. A message may state facts about the client's own input (its length, a character outside the allowed set) and the state of the credential (not registered, expired), never the secret.
Sub-issues (in order)
- SI-A: Keep secrets out of errors, logs and output. After Remove source locations from the errors of torrust-tracker-core #2916 merges.
- SI-B: Define and apply the client error text policy. An ADR first; code after the maintainer accepts it.
The sub-issue specifications are drafted after the EPIC specification is merged.
Specification
docs/issues/open/<this issue number>-secrets-and-client-error-text/EPIC.md (added by the spec-only PR). It holds the full inventory: secrets in errors and output, what each protocol sends a client, and the skills, ADRs and documents about handling secrets.
Activity
docs(issues): [torrust#2993] draft the two sub-issue specifications o…
docs(issues): [torrust#2993] list A10 and A11 in the inventory table …
docs(issues): [torrust#2993] mark the quoted key-length message as ve…
Merge #2991: fix(tracker-core): [#2916] remove source locations from …
docs(issues): [torrust#2993] record the reproductions of the EPIC inv…
docs(issues): [torrust#2993] reach the tracker database error through…
docs(issues): [torrust#2993] assign database errors that hold a secre…
docs(issues): [torrust#2993] require the incremental test-design revi…
Merge torrust/develop into 2993-secrets-and-client-error-text-spec (r…
docs(issues): [torrust#2993] refresh the inventory after SI-4 of EPIC t…
chore(issues): archive closed issue #2916 spec to docs/issues/closed
Merge #2997: chore(issues): archive closed issue #2916 spec to docs/i…
docs(issues): [torrust#2993] fix the review round 3 findings in the e…
docs(issues): [torrust#2993] move the SI-A and SI-B specifications to…
docs(issues): [torrust#2993] fix the review round 4 findings in the E…
16 remaining items
docs(issues): [torrust#2993] name the PR behind the spec-only checkpo…
docs(pr-reviews): [torrust#2993] record review round 5 of PR 3014
docs(pr-reviews): [torrust#2993] record review round 6 of PR 3014
docs(pr-reviews): [torrust#2993] record review round 7 of PR 3014
Merge #3012: fix(tracker-client): [#3004] do not write the tracker ke…
Merge #3014: docs(issues): [#2993] recheck the EPIC and sub-issue spe…
docs(issues): [torrust#2387] correct the SI-3 finding about EPIC torr…
Merge #3024: docs(issues): [#2387] record order B′ and recheck the EP…
docs(issues): [#2993] record the overlap with EPIC #2387
Merge #3025: docs(issues): [#2993] record the overlap with EPIC #2387
Merge #3038: chore(issues): [#384] archive the SI-7 spec to docs/issu…
Merge #3042: fix(secrets): [#2999] keep secrets out of errors, logs a…
Merge #3050: chore(issues): archive closed issue #2999 spec to docs/i…
Merge #3063: docs(adrs): [#3000] add the client error text policy ADR
Merge #3075: docs(issues): [#144] record EPIC state and inputs report…