Skip to content

Job-declaration and mining messages print authorization tokens in Display and Debug #2364

Description

@bit-aloo

AllocateMiningJobTokenSuccess.mining_job_token, DeclareMiningJob.mining_job_token, DeclareMiningJobSuccess.new_mining_job_token and SetCustomMiningJob.token are bearer capabilities (the field docs say possession lets a JDC commit or identify a custom job), and AllocateMiningJobToken.user_identifier may carry client authentication material. Every one of these messages, borrowed and owned, prints the value as hex in Display and in full through derived Debug, and the parser enums delegate to them, so ordinary message logging or a panic persists a replayable credential outside the encrypted connection. #2335 fixed the copy held by channels_sv2::JobOrigin; the message types themselves still leak.

Fix: hand-written Display and Debug on these five messages (and their Owned twins) that print <redacted> for the token and identifier fields, with a regression test asserting neither the raw bytes nor their hex appear.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions