Repository navigation
fix(api): update systeminformation to 5.33.19 - #3582
kodiakhq[bot] merged 7 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 Review✅ No critical issues found. This is a tightly scoped security dependency bump: the root
No P0/P1 or P2 findings. The two points raised in the prior Deep Review ( 🔵 P3 nitpicks (1)
Reviewers (3): correctness, testing, maintainability. Security, project-standards, and previous-comments reviewers were also dispatched but had not returned when the report was finalized; those domains were covered by direct verification of the resolution/lockfile graph, the advisory range, the age gate, and the prior PR 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: |
Since ClickHouse#3575 the API installs systeminformation through @opentelemetry/instrumentation-host-metrics, not @opentelemetry/host-metrics. That package asks for ^5.31.6, but the old ^5.24.0 pin held it at 5.30.7.
|
Pushed b631892. Since #3575, the API gets |
|
@teeohhem my push dismissed your approval, sorry about that. The only change since you approved is the changeset wording above, plus the |
Summary
The root
resolutionsblock pinssysteminformationto^5.24.0, andyarn.lockresolves it to 5.30.7.@hyperdx/apiinstalls it through@clickhouse/clickstack-node→@opentelemetry/auto-instrumentations-node→@opentelemetry/instrumentation-host-metrics0.6.0 (since #3575), so it is in the API image. That package asks for^5.31.6, but the old pin holds it at 5.30.7.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:
@opentelemetry/auto-instrumentations-nodeleaves host metrics off by default (defaultExcludedInstrumentations).packages/api/src/telemetry.tsturns them on only whenNODE_ENV=developmentand an API key is set, and the Docker images setNODE_ENV=production. An operator can still turn them on withOTEL_NODE_ENABLED_INSTRUMENTATIONS. The instrumentation callsnetworkStats()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.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/instrumentation-host-metrics@npm:0.6.0(before #3575:@opentelemetry/host-metrics@npm:0.35.5).node_moduleshas one copy, 5.33.19.The API starts with the new version. On this branch after #3575, I started
packages/api/src/index.tswithNODE_ENV=developmentand thesrc/telemetry.tspreload (theyarn devcommand, without nodemon and dotenv), a dummyHYPERDX_API_KEY, and the OTLP exports sent to a local HTTP listener. The first metrics export hadsystem.cpu.time,system.memory.usage,system.network.ioandsystem.network.errors. The log had no uncaught errors or unhandled rejections. Before #3575 I ran the same check with@opentelemetry/host-metrics0.35.5, with the same result.For the before/after checks I used two small installs with the pre-#3575
yarn.lockversions of@opentelemetry/host-metrics(0.35.5),@opentelemetry/sdk-metrics(1.30.1) and@opentelemetry/api(1.9.0). Thesysteminformationcall in@opentelemetry/instrumentation-host-metrics0.6.0 (build/src/stats/si.js) is the same code as inhost-metrics0.35.5, so these results apply to the current dependent too. 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)