Skip to content

Adds fuzz test for ReadTruncatedBody - #1541

Draft
gdavison wants to merge 2 commits into
td-read-truncated-body-err-handlingfrom
td-fuzz-read-truncated-body
Draft

gdavison wants to merge 2 commits into
td-read-truncated-body-err-handlingfrom
td-fuzz-read-truncated-body

Conversation

@gdavison

Copy link
Copy Markdown
Collaborator

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Reference: #0000 <!--- Pull Requests should have an associated issue or may be closed --->

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

Adds fuzz tests for ReadTruncatedBody


Stack created with GitHub Stacks CLI • Give Feedback 💬

@gdavison
gdavison requested a review from a team as a code owner October 16, 2026 22:29
@gdavison
gdavison added this pull request to stack #1545 October 16, 2026 22:29
@gdavison
gdavison requested a balanced review from Copilot October 16, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new discard can block streaming body logging, and truncated-output assertions miss partial credential leaks.

2 open issues
What changed in this PR

Adds fuzz coverage for HTTP body logging’s ReadTruncatedBody helper.

Changes:

  • Adds fuzz seeds and normalization, length, and masking assertions.
  • Adds CRLF and trailing-data error regression tests.
  • Discards buffered data before checking for reader errors after truncation.
File Description
logging/​testdata/​fuzz/​FuzzReadTruncatedBody/​be5745a00b72578c Adds a persisted fuzz input.
logging/​http.go Changes error detection after truncation.
logging/​http_test.go Adds newline and reader-error regressions.
logging/​http_fuzz_test.go Adds fuzz testing and normalization helper.

Review effort: Balanced

Comment thread logging/http.go Outdated
Comment thread logging/http_fuzz_test.go Outdated
@gdavison
gdavison removed this pull request from stack #1545 October 17, 2026 00:06
@gdavison
gdavison changed the base branch from main to td-read-truncated-body-err-handling October 17, 2026 00:08
@gdavison
gdavison force-pushed the td-fuzz-read-truncated-body branch from 349881e to 4af560a Compare October 17, 2026 00:15
@gdavison
gdavison added this pull request to stack #1547 October 17, 2026 00:16
@gdavison
gdavison requested a balanced review from Copilot October 17, 2026 00:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused test-only changes have no identified blocking issues and leave production behavior unchanged.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@gdavison
gdavison marked this pull request as draft October 18, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants