fix(webrtc): remove vulnerable unmaintained stun package dependency #2967
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This is my second attempt, I put it on a completely clean feature branch this time.
Title
Description
This PR removes the dependency on the abandoned
stun
package from the WebRTC transport implementation, which had critical security vulnerabilities through its dependencies:ip
: SSRF vulnerability in isPublic categorizationparse-path
: Authorization bypass vulnerabilitytrim-newlines
: Uncontrolled resource consumptionyargs-parser
: Prototype pollution vulnerabilityThe change replaces the STUN message handling with the built-in implementation from
@ipshipyard/node-datachannel
, which we already use for most of our WebRTC functionality. This simplifies our dependency tree and removes these security issues without affecting functionality.All tests are passing and npm audit now reports zero vulnerabilities.
Notes & open questions
The change was straightforward as we already had a more secure alternative available through our existing dependency. No API changes were required.
Change checklist