Skip to content

fix(puter-js): guard PWispHandler against unknown stream ids - #3474

Open
Ayush7614 wants to merge 1 commit into
HeyPuter:mainfrom
Ayush7614:fix/wisp-unknown-stream-guards
Open

fix(puter-js): guard PWispHandler against unknown stream ids#3474
Ayush7614 wants to merge 1 commit into
HeyPuter:mainfrom
Ayush7614:fix/wisp-unknown-stream-guards

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

Summary

  • DATA / CONTINUE / CLOSE frames for missing streamMap entries null-dereferenced and crashed the shared Wisp relay onmessage handler.
  • Look up the stream first and ignore unknown ids (also guard a missing parse result).

Why this is real

Late/duplicate frames after close, or hostile stream ids, could take down every socket sharing that Wisp connection.

Test plan

  • New tests fail before the fix and pass after for unknown DATA/CONTINUE/CLOSE
  • vitest run src/puter-js/src/modules/networking/PWispHandler.test.js — 10 passed

DATA/CONTINUE/CLOSE frames for missing streamMap entries null-dereferenced
and crashed the shared relay onmessage handler. Ignore unknown streams
instead of assuming the entry exists.
@ProgrammerIn-wonderland

Copy link
Copy Markdown
Collaborator

@r58Playz can you review

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