Skip to content

prevent sensitive header value being logged - #289

Merged
Kriechi merged 3 commits into
python-hyper:masterfrom
daddykotex:dfrancoeur/sensitive-headers
Mar 15, 2026
Merged

prevent sensitive header value being logged#289
Kriechi merged 3 commits into
python-hyper:masterfrom
daddykotex:dfrancoeur/sensitive-headers

Conversation

@daddykotex

@daddykotex daddykotex commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

See #288

Comment thread src/hpack/hpack.py Outdated

When sensitive is True, the header value will be redacted in debug logs
and logged as "SENSITIVE_REDACTED" to prevent accidental exposure of
sensitive information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mention that this flag has a specific meaning also in the RFC. Currently an unaware user might read this sentence and assume this setting is only for logging - while in fact it has a more specific meaning on the protocol level as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-written as:

        When sensitive is True, the header will not be added to the header table,
        furthermore, the header value will be redacted in debug logs, as "SENSITIVE_REDACTED",
        to prevent accidental exposure of sensitive information.
@Kriechi

Kriechi commented Mar 14, 2026

Copy link
Copy Markdown
Member

Would you mind adding a changelog entry and tests to cover the new behaviour? Thanks!

@daddykotex
daddykotex force-pushed the dfrancoeur/sensitive-headers branch from 63513fa to b7a31bc Compare March 14, 2026 18:27
@daddykotex
daddykotex force-pushed the dfrancoeur/sensitive-headers branch from b7a31bc to 6b99d12 Compare March 14, 2026 18:34
@daddykotex

Copy link
Copy Markdown
Contributor Author

Would you mind adding a changelog entry and tests to cover the new behaviour? Thanks!

Done!

@daddykotex
daddykotex marked this pull request as ready for review March 14, 2026 18:35
Comment thread src/hpack/hpack.py Outdated
Comment thread CHANGELOG.rst Outdated
@Kriechi
Kriechi merged commit 1621490 into python-hyper:master Mar 15, 2026
8 checks passed
@Kriechi

Kriechi commented Mar 15, 2026

Copy link
Copy Markdown
Member

Thanks @daddykotex! 🎉

closes #288

@daddykotex

Copy link
Copy Markdown
Contributor Author

Thanks again @Kriechi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants