Bump npm dependencies (npm audit)#177
Conversation
The mocha bump is mostly to suppress warnings when running audit tools, as the risk seems negligible in test/CI tool, no user input. Network libraries referenced by bonjour pose a slightly more concrete threat, as developers using the replay tool could in principle be operating in networks with maliciously crafted network packages circulating.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Don't see any issue with this, the package bundles minified builds for use in browsers.
That minified file is not referenced as executable by the package.json file (sadly, npm does not allow deep linking). |
|
I still get warnings with I don’t understand why it suggests an older version of mocha. |
I did not check, but I assumed that it thinks that the older version does not depend on the vulnerable versions of the libraries. Since these libraries don't run on unknown input, I didn't think these issues were concerning and would just wait out an updated version of mocha (v12, I assume). |
|
Thanks, sorry for not catching this myself. The innocuous seeming bump PR in bonjour implies that there were some changes to how TXT entries are handled: watson/bonjour#82 watson/bonjour@v3.5.0...v3.5.1 I patched the logging code for service discovery: diff --git i/src/dividat-driver/websocket/main.go w/src/dividat-driver/websocket/main.go
index fef0a96..652edfc 100644
--- i/src/dividat-driver/websocket/main.go
+++ w/src/dividat-driver/websocket/main.go
@@ -223,7 +223,8 @@ func (handle *Handle) dispatchCommand(ctx context.Context, log *logrus.Entry, co
go func(entries chan protocol.DeviceInfo) {
for entry := range entries {
- log.WithField("service", entry).Debug("Discovered service.")
+ jsonb, _ := entry.MarshalJSON()
+ log.WithField("service", string(jsonb)).Debug("Discovered service.")
var message protocol.Message
message.Discovered = &entry
This shows that where on I rechecked the CVE for I wonder whether we should even bother with this update. Maybe the replay tool (and possibly tests) are minimal enough to allow us a rewrite in Go, Python (or of course Rust™) and avoid Node ecosystem entirely here. |
Trying to upgrade to 3.5.1 breaks the serialization of mDNS txt entries in the replay tool, after which the simulated Senso's mDNS data can not be parsed by the app and will therefore not be found. v3.5.1 of `bonjour` was a bump triggered by a vulnerability alert ultimately stemming from a faulty predicate function in the `ip` package, misclassifying some public/private IPs[^1]. `ip` is a transitive dependency brought in by `dns-packet`. `dns-packet` only uses `ip` to serialize addresses, not to classify them[^2]. [^1]: watson/bonjour@v3.5.0...v3.5.1 [^2]: https://github.com/mafintosh/dns-packet/blob/v1.3.4/index.js


Manually bumped "bonjour" and "mocha" to latest versions, then ran
npm audit fix.Impact seems limited as all dependencies are used in dev/CI testing tools. Only possibly meaningful risk would be malicious network packages when replay tool is running on a dev machine.
Checklist