Fix command-injection in network monitor (use execFile) and add tests - #14
Closed
rtrappman-dev wants to merge 1 commit into
Closed
rtrappman-dev wants to merge 1 commit into
rtrappman-dev wants to merge 1 commit into
Conversation
rtrappman-dev
deleted the
codex/find-critical-security-or-functional-issues
branch
September 8, 2026 02:43
rtrappman-dev
restored the
codex/find-critical-security-or-functional-issues
branch
September 8, 2026 03:11
rtrappman-dev
deleted the
codex/find-critical-security-or-functional-issues
branch
September 8, 2026 03:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Description
sensor/NetworkMonitorSensor.jswith a safe command boundary that calls a new helperutil/NetworkMonitorCommand.jswhich usesexecFileand passes every user-controlled value as an argument.ping,dns, andhttphelpers inutil/NetworkMonitorCommand.jsthat runsudo ping,dig, andcurlrespectively and parse the timing output without invoking a shell.--when invokingcurland validate that DNS/HTTP/ping targets are supplied as literal arguments to prevent option or shell injection.test/test_network_monitor_security.jsthat assert payloads containing shell metacharacters are passed as single literal arguments and validate the parsing behavior.Testing
npx mocha --exit test/test_network_monitor_security.js, which passed (2 passing).node -consensor/NetworkMonitorSensor.jsandutil/NetworkMonitorCommand.js, both succeeded.git diff --checkto confirm no whitespace/patch issues; no problems found in the working tree.Codex Task