Repository navigation
feat: PHP2Shell exposure check, PHP worker crash alert, scan-finding dedup fix - #13
Merged
Merged
Conversation
…ashes PHP2Shell (CVE-2026-109618, CVE-2026-109619) is unauthenticated RCE in the PHP interpreter; the fix is upgrading PHP. Each sniff pass now reads the PHP version on the host and in running containers (dpkg/apk package database through MergedDir, and PHP_VERSION from official images) and alerts on builds older than 8.2.35, 8.3.36, 8.4.27 or 8.5.12 (vuln.php2shell). Upstream builds get a Critical alert. Distribution packages get a Medium "check your vendor" alert, because backports keep the old version number. Alpine's version is read from php8x-common, which every SAPI depends on. php.worker-crash alerts when 3 or more php-fpm or Apache workers die on SIGSEGV/SIGBUS/SIGABRT/SIGILL in one log source within one pass. Log formats are taken from php-src fpm_children.c and httpd unixd.c. Neither finding names a client, so both are on the never-ban list. Also fixes alert dedup for scan findings. They had no log source, so every finding of one detector shared a key and only the first of a pass alerted. A second exposed install, a second shell file or a second integrity change was silently dropped. Scan findings now key on their sample line, which names what was found. Log findings are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
PHP2Shell (CVE-2026-109618, CVE-2026-109619) is unauthenticated RCE in the PHP interpreter. The fix is upgrading PHP; Stackdog cannot patch it and does not detect the exploit request. This PR adds what Stackdog can do about it.
vuln.php2shell(src/detectors/php2shell.rs). Each pass reads the PHP version on the host and in running containers, and flags builds older than 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12, or any 8.1 and older.MergedDir), andPHP_VERSIONfrom official images (docker-libraryDockerfile-linux.template:224).php8.x-commonandphp8x-common/php8x. Thephpmeta-package and PECL extensions carry their own numbering.STACKDOG_PHP_VERSION_CHECK_ENABLED=falseturns the check off.php.worker-crash: alerts when 3+ php-fpm or Apache workers die on SIGSEGV/SIGBUS/SIGABRT/SIGILL in one log source within one pass. Log formats come from php-srcfpm_children.c:269,308and httpdos/unix/unixd.c:439.Neither finding names a client, so both are on the explicit never-ban list.
Dedup fix (
src/sniff/reporter.rs): scan findings have no log source, so all findings of one detector shared one key and only the first per pass alerted. This silently dropped:Scan findings now key on
sample_line(a path, container, or package and version). Log findings keep the detector-only key, because their sample is a timestamped log line.Docs: README, CHANGELOG,
.env.sample, a website PHP2Shell section, the docs settings table, and the quick-start.env.A code review on the branch found the dedup bug, missed Alpine installs (
php83-commonwithoutphp83), and an overstated crash threshold wording; all three are fixed here.Verification
cargo test: 455 + 8 + 108 passed, 0 failed, 1 ignored.cargo clippy --all-targets -- -D warningsandcargo fmt --checkare clean.cd website && npm run build: OK.Not verified
PHP_VERSIONthrough bollard inspect has not been tried against a live container.🤖 Generated with Claude Code