DEW #171 - Threat Emulation Context, Onboarding a Security Agent & lol php
Welcome to Issue #171 of Detection Engineering Weekly!
✍️ Musings from the life of Zack:
Every week, I read, watch and listen to all the Detection Engineering content so you can consume it all in 10 minutes. Subscribe and get a weekly digest of the latest and greatest in threat detection engineering!
I’m in NY this week at the Datadog office! I’m crossing a restaurant off my bucket list and will be eating with some of my college friends at Per Se. I’ve seen this restaurant on like 50 cooking shows at this point so I’m excited to experience it for myself :)
The Datadog Detection Engineering and Security Research team is hosting an IN PERSON Detection Engineering conference in Chicago on November 2! It’s a continuation of our Datadog Detect series, and the speaker and topic list is awesome. Registration is still open, and we want to make sure it’s packed to support the speakers and to spread some Detection knowledge :)
💎 Detection Engineering Gem 💎
Cloud Threat Emulation on Autopilot: Context is Everything by Terrance DeJesus and Bryan Porras Blanch
In this blog, Elastic Security Researchers DeJesus and Blanch showcase their agentic threat emulation methodology. My mental model for threat emulation testing follows a similar path to software engineering testing:

Unit tests
Software Engineering: Test one small component in isolation, usually a function or component
Detection Engineering: Isolated atomic tests generally on one log or contained “attack”
Integration tests:
Software Engineering: Test two or more components together. Think an API call → database query
Detection Engineering: Testing two or more rules, where the logs or compound alerts are necessary to generate a higher-level alert
Regression tests:
Software Engineering: Re-run tests after a piece of code changes, ensuring existing contracts in other tests still hold true
Detection Engineering: Nearly identical, but swap code changes to rule changes!
End-to-end tests:
Software Engineering: Test a full workflow, either from a user or something automated, validating that the system behaves from “the outside”
Detection Engineering: Test a full attack chain, with prerequisite environment configuration and context, to ensure the full attack scenario propagates the correct telemetry and alerting
I think the hardest part of any end-to-end detection testing is modeling the environment. This becomes more of a DevOps problem than a security problem. You risk biasing your testing by reducing the problem down to the minimal environment needed to replicate the attack. A minimal environment isn’t your enterprise environment. To combat that bias, Blanch and DeJesus approached emulation by first building the attack's threat model, then working backward.
They also had clever ways to give the emulation run a report card.
Similar to what we’ve seen with the previous issue’s Gem on rating your AI SOC output with validation gates, this looks like a validation gate for emulation.
🔬 State of the Art
How to start the AI-accelerated defense by Wade Wells
My biggest takeaway for “doing AI in security” in the second half of this year is that context and memory are the most important layers for making a program successful. It kind of makes sense: if you bring in a fresh SOC analyst or incident responder and don’t give them any information during onboarding regarding your tools, logging requirements, rules, and internal knowledge databases, do you think they would be set up for success? Since Agents run on context, why not give them context versus relying on vanilla or 1-shot prompts to investigate an alert?
This retrospective from friend-of-the-newsletter and detection veteran, Wade Wells, shines some light on how the 1Password team tackled their AI adoption journey. They started treating their security agents like employees and built systems and memory layers to give them access to context during investigations. Wells wrote this like a blueprint for others on this journey, which I appreciated because some of it seems obvious now that I am reading it, but I wouldn’t have thought of it on my own:
Detection rule library: this is the most obvious to me, but spending time on having up-to-date rules with corresponding runbooks helps a lot here
Team charters: this is a new one that I’m going to steal. Basically, it helps reconcile the infrastructure with the humans who own it. So when you need to escalate or page someone, the agent does that work ahead of time and gives you the right contact info
Log inventory: I had to zoom in on the picture displayed here, but it’s a spreadsheet of all critical log sources, their categories such as endpoint or Cloud, and corresponding priority of importance
My big takeaway here is that if some knowledge base is useful for you as a security engineer, it’ll likely be useful for a security agent.
Detection fidelity in the age of AI agents living off the land by Julien Vehent
This short-but-sweet blog addresses an issue I’ve seen a lot of people talk about in the cloud workload space, but it still makes sense in the endpoint space: when is an agent’s intent malicious and when is it benign? When you have a frontier model running an investigation on a failed networking call in a piece of code, it might load living-off-the-land binaries like tcpdump or netcat to troubleshoot. In the past, we would look at a normie’s computer (aka not in engineering) and assume malicious activity, since normies don’t like networking tools.
Vehent argues that these “tripwires” lose their fidelity once agents use the same tooling for legitimate work, and that the fix is correlating weak signals and giving agents their own identity, so you can tell their tcpdump apart from an attacker’s.
I’d take it a step further here, though. I don’t think Vehent is suggesting that correlated rules are the answer, as if they haven’t always been. It’s more so that correlation matters even more, because you now have to differentiate three identities. The human, their agent(s), and the attacker. So, IMHO, assume regular users’ machines will run things like tcpdump, because more capable models with thinking modes hide a lot of this busywork from the person who asked. Ask an agent to debug your WiFi, and it may end up building its own tcpdump in Rust :).
AI Agent Artifact Catalog by Raymond DePalma
This is a neat site (and corresponding GitHub repository) that helps centralize knowledge around artifacts left by AI agents during detection and forensics work. The current iteration includes dozens of AI tools, from Claude Code to Cursor, along with their corresponding artifacts (executables, Markdown files) and their forensic value.
For example:
AIRT-0011 documents Claude Desktop’s MCP log, where you can find the full tool-call transcript Claude used against various MCP servers. It’ll list things like abuse potential (adding rogue MCPs or malicious ones) and documented incidents in the wild.
Huntbase Hub by Huntbase
This “Hub” is a freemium product you can sign up for to get hunt ideas sent directly to your inbox, or you can point your agents to it as well. The cool part about some of these entries is that they give step-by-step instructions for the hunt based on the context of the threat research story. This example hunt is based on Huntress research into ConnectWise M365 attacks and has a few clever things I wanted to point out. First, it starts out with a description of “Why this matters”. Many hunts get lost at the start because the threat research or attack seems cool rather than relevant.
In this case, attackers used a supply chain attack against ConnectWise and customer-configured OAuth credentials stored in ConnectWise to pivot into victim M365 environments. It lists the steps it needs to take to perform the hunt and its decision steps in a SOAR-like decision-tree view. Products like this are nice because they build in the open, and you can compare and contrast how to build an agentic threat hunt and see whether you can incorporate some of Huntbase's best parts into your workflows.
☣️ Threat Landscape
Security advisory: Critical remote code execution vulnerabilities, update now by PHP
The big news from this week is not one but two PHP vulnerabilities. According to the PHP team, all PHP installations serving web requests are vulnerable to CVE-2026-109618 and CVE-2026-109619, which is millions of devices on the Internet. W3techs alone puts 58.3% of websites who host a content management system host WordPress. Both vulnerabilities are rated Critical (CVSS v4.0: 9.2) and can lead to unauthenticated remote code execution. Here’s the quote I’m most worried about:
PHP 8.1 and older no longer receive updates from the PHP project. Some distributions and LTS vendors provide backported fixes, so contact your vendor for details, or upgrade to a supported version.
Today's PHP Security Release, and How We're Strengthening PHP Security by The PHP Foundation
This blog by the PHP foundation is where things get very spicy. Basically, the blog outlines the Foundation’s recent security developments with the use of third party security reviews since 2024 and the use of Mythos and other cyber foundational models. The team did not say how the vulnerability was disclosed, but they write that one of the security firms who found the vulnerability, Calif, leaked details of the vulnerability via a video. Calif deleted the video from social media, but I have a copy and uploaded it for you all to view here:
The video itself showed some PoC details, and this is where the beauty of LLMs came in. Several research teams, including us at Datadog, took the video, OSINT from social media and the sparse details released by PHP and recreated the PoC.
The PHP Foundation team says things were going well until two days before the disclosure. The CVEs were leaked, and then the video was posted on Calif’s Twitter account and was subsequently removed. Separately, they put Chainguard on blast and blamed them for pre-releasing patches that were under embargo before the embargo was lifted:
On October 21st at 07:41 UTC, more than six hours before the coordinated release, Chainguard unilaterally broke the embargo and published built images containing the fix. Like other distributors, Chainguard had received the patch in advance so its users could update the moment the vulnerabilities were disclosed. Any attacker could now study the fix in binary form while every other PHP user was still waiting for the release. This disregarded weeks of work by many parties toward a coordinated disclosure.
So according to The PHP Foundation, this effort was botched within a two day window. If you compare this to how life was in security before LLMs, a video wouldn’t be able to show enough where we could build our own PoC. But our teams did it in < 1 hr with GLM 5.3 using an anime girl meme video.
What a world we live in.
A tale of two PHP remote vulnerabilities by Ryan Austin
This blog post by Calif is from the company that the PHP Foundation Team referenced in their above blog. I found it strange that half of the blog is a.. comic book? The illustrations are pretty but the interesting vulnerability finding work is on the second half of the blog.
According to the blog, the vulnerabilities were found by Calif, Wiz and OpenAI and all default configurations of PHP that go back to version 5.4.0 are vulnerable. The blog goes much deeper than the above PHP posts, but the bugs basically result from what happens when PHP runs out of memory partway through a request.
In the first, PHP records a new entry in an internal table before it finishes creating it. The attacker then triggers the out-of-memory error right then, and the cleanup code later trusts the half-built entry and frees memory the attacker controls. In the second, the same kind of crash during file-upload handling frees the request’s memory but leaves session data pointing at it, and the attacker’s next request uses those stale pointers.
Oct 21 Advisory: PHP Unauthenticated Remote Code Execution [CVE-2026-109618, CVE-2026-109619] by Censys Threat Research
Following the vulnerability disclosures, the Censys Threat Research team fingerprinted PHP servers across the Internet and got a good snapshot of exposure for readers and researchers. The snapshot from yesterday showed 6.2 million hosts with vulnerable versions.
There isn’t a specific mix shown here across the technologies referenced by Calif, so there’s likely a good mix between Drupal, Wordpress, phpMyAdmin and others. The thing I am most worried about across this list is not run-of-the-mill Wordpress CMS websites, but moreso appliances like Citrix or Palo Alto devices that are EOL or have terrible updating capabilities.
PHP2Shell - Critical vulnerabilities in PHP (CVE-2026-109618, CVE-2026-109619): detection, analysis, and remediation by Nick Frichette, Eslam Salem and Emile Spir
~ Note, Datadog is my current employer and Nick, Eslam and Emile are my esteemed colleagues ~
I’m on site at the Datadog NY office this week so these PHP vulnerabilities have been keeping both our internal security and security research teams busy. If you want a much deeper dive about the vulnerability and the exploitation primitives, the team here goes into deep detail on how each vulnerability is triggered:
Nick built a PoC from the available OSINT prior to the previous blog disclosures, so it goes to show how fast these things can develop with LLM capabilities.
🔗 Open Source
Selfedge is a self-hosted website builder that operates like a dynamic honeypot. It detects when it is getting probes and live edits itself to add honeytokens or tripwires to adjust to the attacks it’s receiving. I think it’s an interesting concept in the sense that it’s a malleable honeypot, but I haven’t played around with it enough where I can say it won’t give you the same type of results as you see as other LLM-based honeypots.
depalmar/ai-dfir-toolkit
This is an interesting corpus of detection rules, forensic artifacts and threat intel that focuses heavily on attacks against AI systems. It contains nine attack categories, from prompt injection and MCP tool poisoning to agent memory poisoning, and each category has a mix of Sigma, YARA and Suricata rules mapped to ATLAS and OWASP.
The artifact catalog is probably the most useful. Similar to Raymond DePalma’s blog above on AI Agent Artifact catalog, it is a structured feed of tools, credential and configuration locations and case studies for coding agent attacks.
php2shell-protection is a small configuration tweak you can add to vulnerable PHP deployments to protect against php2shell. It’s an .htaccess file that caps POST requests to 8 megabytes, which helps protect against CVE-2026-109618.
CVE intel is a web app you can run locally that connects to nearly 40 sources of intel to enrich whatever CVE you enter. It connects to the usual sources for CVE intelligence like CISA KEV, NVD and CVSS services but has some other neat intel sources like GreyNoise so you can get a full picture. You can also drag-and-drop a coding directory and it’ll load the SBOM and perform vulnerability scanning.
Every week, I read, watch and listen to all the Detection Engineering content so you can consume it all in 10 minutes. Subscribe and get a weekly digest of the latest and greatest in threat detection engineering!

















































































