Fix: S8 text-signature false positives in iccPawgReport (#1271)#1274
Merged
Conversation
The case-insensitive TextSig table (<script, <html, <?php, javascript:, invoke-expression, iex(, cmd.exe, /bin/sh, ...) matched by HasAsciiSignatureCaseInsensitive performed no context validation, so a coincidental match inside high-entropy CLUT data fired S8 -- e.g. the "PowerShell expression invocation" (iex() false positive on SWOP2013C3_CRPC5.icc that #1270 unmasked once the ELF hit was corroborated away. These signatures are dangerous only as text, so a genuine hit sits inside printable content. HasAsciiSignatureCaseInsensitive now requires printable bytes (tab/newline/0x20-0x7e) adjacent to the match, summing to at least 16; a match with little or no printable context (binary CLUT bytes on both sides) is rejected, while a real embedded script/markup payload still fires. Adds standard-tag true-negative / true-positive regression cases to iccdev-pawg-report-regression-tests.sh (generated in-script). Verified: 18/18 pass on the patched binary; the text-sig true-negative FAILs on the pre-fix binary, confirming it guards the gate. Corpus: the lone text-sig false positive (SWOP2013C3_CRPC5) clears with no true positive lost. Refs #1271. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
96fe53a to
4774b77
Compare
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.
Closes #1271. Supersedes #1273 (which was opened from a fork and is blocked by the Fork PR Maintainer Automation Gate because it touches
.github/scripts/; this one is from an upstream branch, same as #1270).Re-lands the text-signature fix onto
master. It was approved and merged as #1272, but #1272's base wasissue-1269; since #1270 was squash-merged to master, #1272's content landed onissue-1269and never reachedmaster. Same single commit on top of currentmaster.Problem
ScanMalwareRange's case-insensitiveTextSigtable (<script,<html,<?php,javascript:,invoke-expression,iex(,cmd.exe,/bin/sh, …), matched byHasAsciiSignatureCaseInsensitive, did no context validation, so a coincidental hit in high-entropy CLUT data fired S8 — e.g. thePowerShell expression invocation(iex() onSWOP2013C3_CRPC5.iccthat #1270 unmasked.Fix
HasAsciiSignatureCaseInsensitivenow requires printable bytes (tab/newline/0x20–0x7e) adjacent to the match summing to ≥ 16; a binary-context coincidence is rejected, a real embedded payload still fires. Signature-local, no dependency, detail strings unchanged.Regression coverage
Standard-tag true-negative / true-positive cases added to
iccdev-pawg-report-regression-tests.sh(CTesticcdev.pawg-report-regressions, ASAN+UBSAN). Verified onmasterbase: 18/18 pass; the text-sig true-negative FAILs on the pre-fix binary, confirming the guard.Approach signed off by @xsscx on #1271; previously approved by @xsscx and @ChrisCoxArt on #1272.
🤖 Generated with Claude Code