fix(baseline): catch .htaccess php-enable persistence in the safety-net #8
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/htaccess-safety-net"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The build-baseline safety-net had a blind spot: a malicious
.htaccess(or an inert.htaccess.jsoncopy) that re-enables PHP execution on otherwise-static files bypassed all three existing filters. It has no<?phptag (so the php-in-templates filter misses it), and it is not named*.php.json/*.phtml(so the extension filter misses it), yet it can turnevil.jpginto executable PHP viaAddType application/x-httpd-php .jpgorphp_flag engine on. This is exactly the persistence class behind the 2026-07-14 docroot incident.What
build-baseline.shgains a fourth safety-net pass (d): it scans the assembledout/for.htaccessand.htaccess.*files whose content matchesAddType/AddHandlermapping PHP onto a non-.phpextension, orphp_flag engine on, and removes them from the baseline output. This keeps the deploy source-of-truth (and therefore the HIDS known-good reference) free of latent PHP-enable persistence.Also in this change:
git rmof the one existing offender in the tree:deployed/helix3/templates/shaper_helix3/.htaccess.json.malware-iocs.pathsappended so the same path is caught as an IOC even if reintroduced upstream.Verification
Re-ran the build;
out/no longer contains any PHP-enabling.htaccess*. The diff against the previously deployed state is limited to the removed offender — no legitimate template.htaccesswas touched (the removed one is an inert.jsoncopy, not the live Apache-read.htaccess).