Repository navigation
fix(api): update systeminformation to 5.33.19 - #3582
BilalAtique wants to merge 3 commits into
Conversation
The root resolutions pin was ^5.24.0, so yarn.lock kept systeminformation 5.30.7. npm audit reports seven advisories for that version, five of them high. Two are command injections in networkInterfaces() on Linux: GHSA-5xpp-75jx-m839 (fixed in 5.31.7) and GHSA-hvx9-hwr7-wjj9 (fixed in 5.31.6). The API installs the package through @opentelemetry/host-metrics, so it ships in the API image. Raise the pin to ^5.33.19, the newest 5.x release. Only the systeminformation entry in yarn.lock changes.
|
@BilalAtique is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 72f8ace The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
PR Review✅ No issues found. |
Deep ReviewScope: 3 files vs base Intent: Remediate command-injection advisories in ✅ No critical issues found. Direct verification of the change:
🔵 P3 nitpicks (1)
Reviewers (4): correctness, maintainability, security, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
|
Thanks. On the Deep Review points:
|
|
E2E shard 1 failed on one test, I don't think this PR causes it. It changes no app code, and the E2E API runs with |
|
E2E shard 4 on 72f8ace stopped before any test ran: |
Summary
The root
resolutionsblock pinssysteminformationto^5.24.0, andyarn.lockresolves it to 5.30.7.@hyperdx/apiinstalls it through@opentelemetry/host-metrics, a production dependency, so it is in the API image.npm auditreports 7 advisories for 5.30.7, 5 of them high. Two of them are the command injections innetworkInterfaces()on Linux from the issue: GHSA-5xpp-75jx-m839 (fixed in 5.31.7) and GHSA-hvx9-hwr7-wjj9 (fixed in 5.31.6).^5.33.19, the newest 5.x release. It fixes all 7 advisories. The last fix (GHSA-3f7j-7jwc-fxfj, Windows) is in 5.33.16.yarn.lockchanges only thesysteminformationentry, from 5.30.7 to 5.33.19.@hyperdx/apiatpatch.Things to be aware of:
packages/api/src/index.tsstartsHostMetricsonly whenNODE_ENV=development, and the Docker images setNODE_ENV=production. Also,host-metricscallsnetworkStats()with no argument. On Linux, that reads only the default interface (ip route, then/sys/class/net/<iface>/...) and does not callnetworkInterfaces(). It calls it only on Windows, or for the'*'argument. I measured this on Linux (see Tests). So this change removes a vulnerable version from the image and from scanner reports. I could not show an exploit through HyperDX.^5.31.0in March. It was stacked on build(deps): add security resolutions for vulnerable npm packages #1740 and merged into the build(deps): add security resolutions for vulnerable npm packages #1740 branch after build(deps): add security resolutions for vulnerable npm packages #1740 had landed, so the bump never reachedmain.@opentelemetry/host-metrics0.40.0 depends onsysteminformation@^5.31.6. Ahost-metricsupdate would also work, but it is a larger change (0.35.5 to 0.40.0), and the root resolution would still override its range. I kept this PR to the resolution.npmMinimalAgeGate.Tests
yarn installwith the repo's Yarn (4.13.0) changes only thesysteminformationentry inyarn.lock.yarn why systeminformationshows5.30.7 (via npm:^5.24.0)onmainand5.33.19 (via npm:^5.33.19)on this branch, both under@opentelemetry/host-metrics@npm:0.35.5.node_moduleshas one copy, 5.33.19.The API starts with the new version. I started
packages/api/src/index.tswithNODE_ENV=development(theyarn devcommand, without nodemon and dotenv) and sent its OTLP exports to a local HTTP listener. The first metrics export hadsystem.cpu.time,system.memory.usage,system.network.io,system.network.errorsandsystem.network.dropped. The log had no uncaught errors or unhandled rejections.For the before/after checks I used two small installs with the
yarn.lockversions of@opentelemetry/host-metrics(0.35.5),@opentelemetry/sdk-metrics(1.30.1) and@opentelemetry/api(1.9.0). An npm override setssysteminformationto 5.30.7 (main) or 5.33.19 (this branch). The Linux runs usenode:22.23.4-alpine, the base of the API image, in Docker (arm64).HostMetricsruns as inpackages/api/src/index.ts, with an in-memory reader, and is collected twice.main(5.30.7)npm audit,systeminformationadvisoriesnetworkInterfaces()withsource /tmp/x;touch${IFS}/tmp/pwned-interfacesin/etc/network/interfaces(GHSA-5xpp-75jx-m839)touchHostMetricswith the same filesystem.network.ioforeth0,touchnot runHostMetricsnetworkInterfaces()andnetworkStats()(Linux and macOS)mainI also logged every child process. On Linux, on both versions,
HostMetricsruns onlyip route 2> /dev/null | grep defaultandcat /sys/class/net/eth0/.... Prettier passes onpackage.jsonand the changeset.Not run: Windows, the Docker image build, ESLint,
tscandknip(no source file or workspace dependency changed).How to reproduce
Starting point: a clone of this repo. Use the repo's Yarn (4.13.0).
On
main:yarn why systeminformation. It showssysteminformation@npm:5.30.7 (via npm:^5.24.0). 5.30.7 is in the vulnerable range of GHSA-5xpp-75jx-m839 (<= 5.31.6) and GHSA-hvx9-hwr7-wjj9 (>= 4.17.0, <= 5.31.5).node:22-alpinecontainer withsysteminformation@5.30.7installed, writesource /tmp/x;touch${IFS}/tmp/pwned-interfacesto/etc/network/interfaces, then runnode -e "require('systeminformation/lib/network').networkInterfaces()"./tmp/pwned-interfacesis created.On this branch:
yarn why systeminformation. It showssysteminformation@npm:5.33.19 (via npm:^5.33.19).systeminformation@5.33.19./tmp/pwned-interfacesis not created.How to test on Vercel preview
N/A — non-UI change.
References
^5.31.0bump did not reachmain)