Skip to content

Validate m_frag_offset_count and offset during cache unmarshal#13165

Open
traeak wants to merge 4 commits into
apache:masterfrom
traeak:cache_fragoffsetcnt
Open

Validate m_frag_offset_count and offset during cache unmarshal#13165
traeak wants to merge 4 commits into
apache:masterfrom
traeak:cache_fragoffsetcnt

Conversation

@traeak
Copy link
Copy Markdown
Contributor

@traeak traeak commented May 14, 2026

Adds an overflow check in case of cache device corruption.

@traeak traeak self-assigned this May 14, 2026
@traeak traeak added the Cache label May 14, 2026
@traeak traeak requested a review from Copilot May 14, 2026 18:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds bounds validation when unmarshaling HTTP cache alternates to guard against corrupted on-disk data triggering out-of-buffer reads via m_frag_offset_count or the embedded fragment-offset pointer.

Changes:

  • Validate m_frag_offset_count and the encoded fragment-offset position against both remaining length and original buffer length in HTTPInfo::unmarshal.
  • Apply analogous validation in HTTPInfo::unmarshal_v24_1 using the "extra beyond integral slots" size.
  • Return -1 (with assertion) on validation failure instead of proceeding with invalid sizes.

Comment thread src/proxy/hdrs/HTTP.cc Outdated
Comment thread src/proxy/hdrs/HTTP.cc Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants