security: validate network inputs before building shell/AT commands#3290
Open
geraldo-netto wants to merge 3 commits into
Open
security: validate network inputs before building shell/AT commands#3290geraldo-netto wants to merge 3 commits into
geraldo-netto wants to merge 3 commits into
Conversation
Harden three places where externally-influenced values were interpolated into command arguments without validation: - NetConf: validate that the IPv4 address and netmask passed to apply_settings are plain IPv4 addresses before they reach ip/ifconfig/iptables, and build iptables rules from already-split argument lists instead of splitting a single string on spaces. A value containing a space can no longer inject extra iptables arguments. - Rfcomm: the CloseRFCOMM handler parsed `ps` output with an unguarded split()/int(), so a malformed or unexpected line raised ValueError and aborted the mechanism. Skip rows that lack a numeric pid and a command. - PPPConnection: validate the APN against the 3GPP label charset before embedding it in the quoted AT+CGDCONT command, preventing break-out of the quoted argument. Add unit + fuzz coverage for each: IPv4 validation (valid/invalid/injection), iptables argument construction (no splitting, delete symmetry), ps-output parsing across malformed inputs, and APN acceptance/rejection with fuzzed payloads. Tests need no D-Bus or display. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cschramm
reviewed
Jun 2, 2026
|
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.



Harden three places where externally-influenced values were interpolated into command arguments without validation:
psoutput with an unguarded split()/int(), so a malformed or unexpected line raised ValueError and aborted the mechanism. Skip rows that lack a numeric pid and a command.Add unit + fuzz coverage for each: IPv4 validation (valid/invalid/injection), iptables argument construction (no splitting, delete symmetry), ps-output parsing across malformed inputs, and APN acceptance/rejection with fuzzed payloads. Tests need no D-Bus or display.