Skip to content

EPIC: Keep secrets out of errors, logs and client replies, and make client error text safe #2993

Open
1 of 2 issues completed

Description

@josecelano-bot

Goal

  1. 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.
  2. 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 token query 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)

  1. SI-A: Keep secrets out of errors, logs and output. After Remove source locations from the errors of torrust-tracker-core #2916 merges.
  2. 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.

Related: #2912, #2916, #384, #2079, #144.

Sub-issues

Sub-issues

1 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added 3 commits that reference this issue on Nov 22, 2026
  2. added a commit that references this issue on Nov 22, 2026
  3. added 6 commits that reference this issue on Nov 22, 2026
  4. added 2 commits that reference this issue on Nov 23, 2026
  5. added 3 commits that reference this issue on Nov 23, 2026
  6. 16 remaining items

  7. added 4 commits that reference this issue on Nov 23, 2026
  8. added 2 commits that reference this issue on Nov 24, 2026
  9. added a commit that references this issue on Nov 24, 2026
  10. added 8 commits that reference this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Security

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions