Conversation
Fix unanchored substring matching in network exfiltration security checks where flags like -f, --form, and verbs like post/put matched inside ordinary hyphenated words, arguments, or URLs (e.g. -for- in iam-helper-for-policy-management, -fuse in cloud-storage-fuse, or --format=json). Enforce CLI flag word boundaries, quote-aware segments, and command position anchoring: - Anchor network client binary invocations to command positions and subshells (bash -c). - Support disjoint quote-aware argument segmentation to prevent ReDoS and avoid slicing into quoted flags (-A, -H). - Enforce explicit HTTP method flags (-X, --request, --method) and verbs (POST, PUT, PATCH). - Support single and double quoted HTTP method arguments, attached data payloads (-dsecret), and file uploads (-T, --upload-file). - Support secret environment variables embedded in complex quoted strings with spaces (e.g. Authorization headers). - Distinguish uppercase multipart -F and clustered short flags (-sSF, -FsS) from lowercase -f (--fail). - Synchronize constants byte-for-byte between eval_core checks and Harbor template via _SHARED_SECURITY_CONSTANTS. - Add grouped and sorted safe and unsafe command regression test suites in tests/tier3/test_checks_secret_patterns.py. Signed-off-by: Karl Weinmeister <kweinmeister@google.com>
kweinmeister
requested review from
chrisknvidia,
mosheabr,
rmalani-nv and
rng1995
as code owners
September 14, 2026 14:47
rng1995
reviewed
Sep 14, 2026
rng1995
reviewed
Sep 14, 2026
rng1995
reviewed
Sep 14, 2026
rng1995
reviewed
Sep 14, 2026
- Identify command executable positions and unwrap shell wrappers - Respect shell quote semantics and redact literal secrets from evidence - Cover HTTPie implicit request bodies and safe query parameters - Replace quadratic regex scanning with bounded single-pass tokenization - Maintain parity between eval_core and standalone Harbor template Signed-off-by: Karl Weinmeister <kweinmeister@google.com>
rng1995
reviewed
Sep 16, 2026
rng1995
reviewed
Sep 16, 2026
rng1995
reviewed
Sep 16, 2026
rng1995
reviewed
Sep 16, 2026
…nwrapping Address PR NVIDIA#141 review feedback on network exfiltration checks: - Support attached option arguments (--data=val, --upload-file=val, --post-data=val, --raw=val) and curl short option bundles (-d, -T, -F, -X). - Unwrap standard execution wrappers (sudo, nohup, doas, stdbuf, setsid, time, builtin, xargs), recursively evaluate eval, exempt inert formatters (echo, printf), and fail closed on unrecognized wrappers with network executables. - Prevent HTTPie format switches (--json, -j, --form, -f, --multipart) from triggering without body evidence, and support field@file form syntax. - Tokenize adjacent/unspaced redirections (<, <<, <<<, >, >>). - Maintain 100% parity between eval_core/checks.py and Harbor templates/eval.py. Signed-off-by: Karl Weinmeister <kweinmeister@google.com>
Signed-off-by: Karl Weinmeister <kweinmeister@google.com> # Conflicts: # CHANGELOG.md
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.
Summary
Fixes false positives in the network exfiltration security check.
The previous check relied on broad substring matching across the entire command string. As a result, benign commands were frequently flagged as security risks. For example:
curl -f -sSorcurl -sSf(which lowercase-matched-Fform uploads).grep -F,awk -F, orunzip -d /tmpfollowing a download.post,put, or--format=json(e.g./blog/posts/123,cloud-storage-fuse).This PR tightens the check so it only triggers on actual exfiltration attempts:
-F,-d,-T/--upload-file) from safe options (-f,-Follow).Authorization: Bearer $TOKEN).eval.py) in sync and adds regression tests covering both safe and unsafe command patterns.Verification
make lintmake testmake buildRelease Impact
CHANGELOG.md