Skip to content

Make Option to Strip Location from Errors sent to Clients #384

Done

Description

@lamgea

Full error-messages, including the code-location are sent to the client.

  • Provide option to strip non-essential information before sending the error to the client.

edit @da2ce7


Screenshot_20230826_021256

Whenever a failure reason is sent, there will be a Location value attached which might reveal some of the internal functionality. It may be a unwanted behavior and potentially dangerous.

Activity

  1. da2ce7 commented on Aug 26, 2023

    @da2ce7
    Contributor

    @lamgea Thank You for your comment and concern. – In general I believe we think that this information is not so sensitive. (edit: of course, we could be shown to be wrong).

    I believe for administrators, and developers, that this information provides a grater benefit than risk: Since we are an open source AGPL project, so the source code should be shared in-any-case with the end users.

    I will keep this issue open, as it is possible that we could create an override that strips the extra info from error messages to comfort the extra careful administrators.

  2. lamgea commented on Aug 27, 2023

    @lamgea
    Author

    Thank for your reply, and it does makes sense. Tracker maintainers can really benefit from this kind of messages if anything really goes wrong. But it will also be nice if we have a option to turn it off.

  3. changed the title [-]The `Location` of errors are included in the `failure reason` returned to the client[/-] [+]Make Option to Strip Location from Errors sent to Clients[/+] on Sep 10, 2023
  4. added
    Security
    - Admin -
    on Oct 10, 2023
  5. moved this to Feature request in Torrust Solutionon Jan 8, 2024
  6. added this to the milestone on Jan 16, 2024
  7. removed this from the milestone on Jun 26, 2026
  8. added 2 commits that reference this issue on Nov 12, 2026
  9. josecelano-bot commented on Nov 17, 2026

    @josecelano-bot
    Contributor

    This issue is now the last sub-issue of EPIC #2912 (Remove source locations from errors).

    The audit in #2804 showed that the recorded location is wrong at every production site and that #[track_caller] cannot fix it, so instead of adding an option to strip it, the EPIC removes source locations from errors entirely (#2913 to #2918). This issue keeps its title and covers the client-side check: a baseline reproduction on a running tracker now, and a recheck after #2913 to #2918 are merged showing that no HTTP, UDP or REST reply holds a source path. It closes after that recheck.

  10. 11 remaining items

  11. added a commit that references this issue on Nov 24, 2026
  12. added 2 commits that reference this issue on Nov 24, 2026
  13. josecelano-bot commented on Nov 24, 2026

    @josecelano-bot
    Contributor

    Outcome: instead of an option to strip the location, the tracker no longer records one. EPIC #2912 removed source locations from the error types, so no reply to a client carries a source path and there is nothing left to strip or configure.

    What changed: the decision is recorded in the ADR "errors do not record source locations" and the work is in EPIC #2912 (sub-issues #2913 to #2918). torrust-located-error is gone from the workspace, and a repository check (source-location-check, CI job "Source Locations") rejects Location::caller(), #[track_caller] and torrust_located_error in non-test code.

    Verification on running trackers (PR #3028): I sent the same 24 error requests to a tracker built before the removal and to one built after it, over the HTTP tracker, the UDP tracker and the REST API, with a listed and a private tracker. 13 replies held a source path before (for example packages/tracker-core/src/whitelist/authorization.rs:61:23, and for a short info_hash a path inside ~/.cargo/registry). After the removal none does, and each reply still says what failed. The captured replies are in evidence/ and manual-verification-evidence.md.

    Server logs are out of scope: tracing events may still name the file and line of the log call. Thank you for the report. This issue will close with the pull request that archives its specification.

  14. added 5 commits that reference this issue on Nov 24, 2026
  15. added a commit that references this issue on Nov 25, 2026
  16. added a commit that references this issue on Nov 25, 2026
  17. moved this from Feature & Enhancement request to Done in Torrust Solutionon Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    - Admin -Enhancement / Feature RequestSecurity

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions