Skip to content

inspector: fix out-of-bounds read in ws frame decoding - #64618

Open
Nashit-h wants to merge 2 commits into
nodejs:mainfrom
Nashit-h:ws-frame-bounds-check
Open

inspector: fix out-of-bounds read in ws frame decoding#64618
Nashit-h wants to merge 2 commits into
nodejs:mainfrom
Nashit-h:ws-frame-bounds-check

Conversation

@Nashit-h

Copy link
Copy Markdown
Contributor

decode_frame_hybi17 checks the announced payload length against buffer.size(), but the payload is read from it + kMaskingKeyWidthInBytes, after the iterator has already walked past the two byte header and the extended length field. A client that sends only the two header bytes of a masked frame, 0x81 0xFD, underflows buffer.size() - kMaskingKeyWidthInBytes to SIZE_MAX, passes the check, and the unmasking loop reads 125 bytes past a two byte vector; the bytes it picks up go to OnWsFrame and back out to the peer. Measuring against what is left after the header fixes both that underflow and the header bytes the old check never accounted for.

Signed-off-by: nashit hayyat <nashit@bugqore.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/inspector

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol. needs-ci PRs that need a full CI run. labels Jul 20, 2026
Comment thread test/cctest/test_inspector_socket.cc
Comment thread src/inspector_socket.cc Outdated
Signed-off-by: nashit hayyat <nashit@bugqore.com>
@cola119 cola119 added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed needs-ci PRs that need a full CI run. labels Jul 26, 2026
@Nashit-h

Copy link
Copy Markdown
Contributor Author

gentle ping

@nodejs-github-bot

This comment was marked as outdated.

@panva panva removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 28, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@legendecas legendecas added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Sep 7, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Sep 7, 2026
@nodejs-github-bot

This comment was marked as outdated.

@panva panva added commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Sep 8, 2026
@panva panva closed this Sep 8, 2026
@panva panva reopened this Sep 8, 2026
@panva panva removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 8, 2026
@panva

panva commented Sep 8, 2026

Copy link
Copy Markdown
Member

@Nashit-h please fix the linter issues, rebase and force push.

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.17%. Comparing base (00917ba) to head (1958e12).
⚠️ Report is 886 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64618      +/-   ##
==========================================
+ Coverage   90.14%   90.17%   +0.03%     
==========================================
  Files         741      771      +30     
  Lines      242076   265173   +23097     
  Branches    45558    50362    +4804     
==========================================
+ Hits       218216   239122   +20906     
- Misses      15385    17017    +1632     
- Partials     8475     9034     +559     
Files with missing lines Coverage Δ
src/inspector_socket.cc 82.90% <100.00%> (+0.04%) ⬆️

... and 403 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. inspector Issues and PRs related to the V8 inspector protocol.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants