Skip to content

Fix Bus.unsubscribe splice(-1) bug and copilot-stream auth validation#504

Open
fuleinist wants to merge 1 commit intorowboatlabs:mainfrom
fuleinist:fix/bus-unsubscribe-and-auth-validation
Open

Fix Bus.unsubscribe splice(-1) bug and copilot-stream auth validation#504
fuleinist wants to merge 1 commit intorowboatlabs:mainfrom
fuleinist:fix/bus-unsubscribe-and-auth-validation

Conversation

@fuleinist
Copy link
Copy Markdown

Summary

Fixes two security/auth bugs reported in issues #493 and #494:

Issue #492: CLI Bus.unsubscribe splice(-1) bug

Problem: without guarding against returning . Double-unsubscribe removes the wrong handler (last element via ).

Fix: Added index guard before splice in both and .

Issues #493/#494: Missing auth validation on copilot-stream-response endpoint

Problem: passes apiKey when Bearer token is missing, allowing requests to bypass auth.

Fix: Added 401 response when token is missing/empty in .

Testing

Both bugs are verifiable by replaying the reproduction steps in issues #492 and #493.

…-stream endpoint

Fixes two security issues:

1. CLI Bus.unsubscribe (issue rowboatlabs#492): Fix splice(-1,1) bug when indexOf returns -1.
   - When unsubscribe is called twice, splice(-1,1) removes the last element instead of doing nothing.
   - Guard with indexOf check before splicing.

2. Copilot stream auth validation (issue rowboatlabs#493/rowboatlabs#494): Return 401 when Bearer token is missing.
   - Extract and validate apiKey before passing to controller.
   - Prevents undefined apiKey from bypassing auth checks.
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.

1 participant