[ Close ]
Enter something in the search box to see results



Issues:[ 1 ][ 2 ][ 3 ][ 4 ][ 5 ][ 6 ][ 7 ][ 8 ][ 9 ][ 10 ][ 11 ][ 12 ][ 13 ][ 14 ][ 15 ][ 16 ][ 17 ][ 18 ][ 19 ][ 20 ][ 21 ][ 22 ][ 23 ][ 24 ][ 25 ][ 26 ][ 27 ][ 28 ][ 29 ][ 30 ][ 31 ][ 32 ][ 33 ][ 34 ][ 35 ][ 36 ][ 37 ][ 38 ][ 39 ][ 40 ][ 41 ][ 42 ][ 43 ][ 44 ][ 45 ][ 46 ][ 47 ][ 48 ][ 49 ][ 50 ][ 51 ][ 52 ][ 53 ][ 54 ][ 55 ][ 56 ][ 57 ][ 58 ][ 59 ][ 60 ][ 61 ][ 62 ][ 63 ][ 64 ][ 65 ][ 66 ][ 67 ][ 68 ][ 69 ][ 70 ][ 71 ][ 72 ][ 73 ]
Current issue : #73 | Release date : 2026-11-17 | Editor : Phrack Staff
IntroductionPhrack Staff
Phrack Prophile on Halvar FlakePhrack Staff
LinenoisePhrack Staff
Escaping from a Docker container through vDSOandersonc0d3
Owning the Truth: Undecidability, unsound kernels, and the forging of proofendrazine, veorq
Cryptographic Ideas for TCC BypassesJonathan Bar Or
Word Machines for Weird Machinesnoperator
Beyond the Facade :: Exposing Smart GiantsLiquidWorm
The Art of Staying HiddenMatheuZSecurity
Reflections on Trusting AI: A Virus Inside an LLMmarver
QNX Userland Shellcode ComponentsClaes M Sjoberg
UAF Exploitation in the Sheaves Eraw1sdom
From PhrackCTF to Two WinFsp 0-daysLucas Tay
fortify-headers: standalone portable header-based implementation of FORTIFY_SOURCE=3jvoisin, sin
Poor Little ChunksAx
The Silent Fleet: AUVs -- Autonomous Underwater VehiclesAmitay Dan
MOLE - A Binary Ninja Plugin for Static Taint AnalysisDamian Pfammatter
Backdoor attacks against Machine Learning IRLG. Cherubin
A Journey Into Kernel Exploit Development in the LLM EraJuefei Pu, Yifan Wu, Kareem Shehada, Zhiyun Qian
Abusing the Windows Smart Card Minidriver ArchitectureMarc Barrantes
Painting Out of the Box: Escaping the Chromium Renderer Sandbox via SkiaQuang Luong
Semantic Abuse of the Linux IIO SubsystemSalah Triki
Disassembly, Flux, and Runtime Hijinksfoosc
Mystique - An x86 Metamorphic CompilerwK
Security is failure: Every Patch Is a GuessTedsig42
The Moon vs The Shield: A Study of Heap Feng Shui Using Lua3nso
HISTORY: Phrack World HistoryPhrack Staff
HISTORY: The 2000 SSH1 exploit that broke the Internetlcamtuf, scut, dvorak, scrippie, portal, gera, skyper
HISTORY: The 2003 Linux Kernel BackdoorAnonymous
HISTORY: BlueBoxing - Myths and Feelingsgamma, skyper
HISTORY: The Proxy That Made No SenseMikko Hypponen

Title : Security is failure: Every Patch Is a Guess

Author : Tedsig42
View as text
|=-----------------------------------------------------------------------=|
|=-----------=[ Security is failure: Every Patch Is a Guess ]=-----------=|
|=-----------------------------------------------------------------------=|
|=-------=[ Ted "Tedsig42" Kouhouenou <[email protected]> ]=--------=|
|=-----------------=[ every-patch-is-a-guess-full.txt ]=-----------------=|
|=-----------------------------------------------------------------------=|
|=------------------=[ every-patch-is-a-guess.tar.gz ]=------------------=|


"Every patch encodes an assumption about what can go wrong.
Your job is to find the assumption -- and watch what it
mutates into."


~ Dedicated to my parents ~
Armel Kouhouenou, 17/08/1975-31/03/2022
Julienne Kouchokeho, 16/02/1977-18/09/2026



--[ Table of Contents


  1. What This Paper Is
  2. The Mutation Model
  3. The Family: Logical Engines
  4. The Differential Audit Loop
  5. The Toolkit: Semgrep, Weggli, ctags
  6. Case Study: nf_tables
    6.1 Architecture: Netfilter Transaction Model
    6.2 Architectural Scatter (Independent Collapse): CVE-2023-35001
    and CVE-2024-1086
    6.3 Incomplete-Fix Variant: CVE-2023-4244 -> CVE-2024-1085
    6.4 From Candidate to Exploit
    6.5 Attacker's Takeaway: Where to Hunt Next
  7. Limits: What the Framework Does Not Find
  8. Epilogue: The Pattern is the Weapon
  9. Acknowledgments
  10. References
  11. About the Author
  12. Attachments
  13. Extended Warm-Ups: Node.js and Apache MINA
    13.1 Warm-Up: Node.js Path Normalization (Predictive Oracle)
    13.2 Warm-Up: Apache MINA Deserialization (Logical Engine)
  14. Extended Case Study: Predictive Oracles (eBPF/JIT)
    14.1 Architecture: eBPF Verifier and JIT Pipeline
    14.2 Trigger A: CVE-2020-27194 [7] (ALU32 Bounds)
    14.3 Trigger B: CVE-2021-3490 [8] (ALU32 XOR/AND)
    14.4 Structural Symmetry Bypass: CVE-2022-23222 [9] (OR_NULL)
    14.5 Structural Symmetry Bypass: CVE-2023-2163 [10] (State Pruning)
    14.6 The Shock: CVSS 10.0 and the Irrelevance of KASLR
    14.7 Attacker's Takeaway: Where to Hunt Next
  15. Extended Case Study: Concurrent Proxies (io_uring)
    15.1 Architecture: Submission Queue and Shared Memory
    15.2 Architectural Scatter: CVE-2021-20226 -> CVE-2021-3491
    15.3 Structural Symmetry Bypass: CVE-2023-2598 -> CVE-2024-0582
    15.4 The Shock: Freeing Pages the User Still Owns
    15.5 Attacker's Takeaway: Where to Hunt Next
  16. Cross-Domain Proof: Windows Authentication Reflection Chain
    16.1 Architecture: Windows Authentication FSM
    16.2 Five CVEs, One Root Cause
    16.3 The Framework Maps Cleanly
  17. Extended References
  18. Extended Appendix
    18.1 Why the Parser Chokes: AST Limits in Kernel Code
    18.2 Family-Specific Seams: Concurrent Proxies
    18.3 Differential Patch Auditing (Complete Reference)
    18.4 Quick-Reference: Tool Patterns by Family
    18.5 Family-Specific Seams: Logical Engines
    18.6 Family-Specific Seams: Predictive Oracles
    18.7 The Hunting Checklist
    18.8 Triage: Separating Candidates from Exploits
    18.9 The Historical Invariant
    18.10 The Hunting Questions
    18.11 What the Framework Does Not Find
    18.12 Fix Analysis
    18.13 Why the Fix Was Incomplete
    18.14 The Shock: From Bug to SLUB Corruption


--[ 1 - What This Paper Is


This is a framework for n-day / variant analysis: given a fixed CVE,
how do you find the next bug in the same family before the attacker
does? The framework uses two tools -- weggli and semgrep -- to scale
a human hypothesis about "what did this patch not cover?" across an
entire subsystem. It is demonstrated end to end on a single Linux
kernel subsystem, nf_tables, through a chain of four real CVEs.


By "bypass" we mean: a bug in the same structural family remains
reachable after a fix lands -- whether because the fix missed a
twin, or because it exposed a pre-existing weakness. Not: we
defeated a mitigation.


This is not an exploit development guide, and the framework finds
candidates, not confirmed vulnerabilities -- Section 7 states the
honest limits (false positives, false negatives, what a classifier
validated on 62 sampled CVEs can and cannot claim). All rules, the
CVE dataset, and validation scripts referenced throughout are in the
uuencoded archive described in Section 12.



--[ 2 - The Mutation Model


When a developer fixes a CVE, they encode an implicit model of the
bug: "it was in this function, on this path, under this condition."
The fix closes that path. For many fixes it does not close every
structurally equivalent path sharing the same underlying weakness --
that is the case this paper is built around, though it is not true
of every patch: some fixes genuinely close a weakness outright, and
a patch can also introduce a new bug of its own rather than merely
fail to cover an old one.


Where it applies, the pattern looks like mutation: the vulnerability
does not respawn identically, it relocates. CVE-2023-4244's fix
removed the per-element busy mark from nf_tables' GC path; five
months after that fix landed (August 2023), a related weakness
surfaced elsewhere in the same subsystem, as CVE-2024-1085 (fixed
January 2024, Section 6.3). This is the operative case study for
everything that follows.


The audit loop in Section 4 surfaces two distinct failure modes,
both shown in Section 6. Incomplete-Fix Variant: the patch closes
one expression of a weakness, but a related path remains reachable
after the fix lands. Two flavors exist: the patch
missed a structurally equivalent twin of what it fixed (the
intuitive case, not demonstrated here), or the
patch removed a guard that had been hiding a pre-existing bug
elsewhere (CVE-2023-4244 -> CVE-2024-1085, Section 6.3 demonstrates
this second flavor). Architectural Scatter: two
independent bugs of the same family, neither a bypass of the other
(CVE-2023-35001 and CVE-2024-1086, Section 6.2) -- proof the same
loop also works as proactive hunting, not only post-patch analysis.



--[ 3 - The Family: Logical Engines


This paper works with one architectural family out of three the
full methodology classifies: Predictive Oracle and Concurrent
Proxy are the other two. A component is a Logical Engine when it
manages objects with explicit lifecycles: create,
destroy, abort, rollback. The failure mode is an asymmetric state
transition -- an abort or cleanup path that does not maintain the
same invariants as the happy path.


This label describes a lifecycle-management shape, not "a logical
bug" in the general sense -- logic errors can and do occur in
validators and concurrency code too; that is a separate axis from
which family a component belongs to.


The hunting question: does this component manage objects with
explicit lifecycles? If you cannot classify a component one way or
another, you likely do not yet understand its architecture well
enough to audit it.



--[ 4 - The Differential Audit Loop


The loop is always the same three steps. Run it after reading any
fix commit for a Logical Engine component.


--------------------------------------------------------------------
STEP 1 -- IDENTIFY THE ADDED CODE in the fix commit.
--------------------------------------------------------------------

Every added line encodes an assumption -- and the assumption is
what the bug will mutate around:


+ if (!nft_is_active_next(net, x)) continue;
-> Are there other functions still using the current-gen
   check instead of the next-gen check?

git show <fix_commit> > fix.patch
grep "^+" fix.patch | grep -v "^+++" | head -40

--------------------------------------------------------------------
STEP 2 -- FIND PARALLEL CODE NOT MODIFIED.
--------------------------------------------------------------------

Search for functions operating on the same data structure that
perform similar operations (_deactivate, _destroy, _free):


grep "^+" fix.patch | grep "struct\|->use\|->refcount\|genmask"
ctags -R net/netfilter/ && grep 'nft_setelem' tags

--------------------------------------------------------------------
STEP 3 -- VERIFY the twins were not patched with the same fix.
--------------------------------------------------------------------
    weggli 'nft_is_active_next(_, _)' net/netfilter/nf_tables_api.c

Question 4 of the checklist below is the single most productive
question for CVE bypass discovery: "If the patch adds a check to
function X, list every function in the file with the same
structural role. Were they patched too?" Post-hoc it flags the exact
call site behind CVE-2024-1085 (Section 6.3). The same question,
asked of the concurrent-proxy family in io_uring, frames the bug
class of CVE-2024-0582 (reported by Google Project Zero).


Hunting checklist, in order:


    1. What family is this component? (Section 3)
    2. What is the nominal path, and what are the exceptional
       paths (abort, cancellation, concurrent modification)?
       Do the exceptional paths keep the same invariants?
    3. What does each function assume about the state it
       receives? Read the first ten lines; write down the
       implicit preconditions; is there a caller that violates
       one?
    4. Is the fix symmetric across every structurally equivalent
       function? (see above)
    5. What changed recently for performance or new features in
       this subsystem? New operation types are where an old
       invariant is most likely to have been forgotten.


--[ 5 - The Toolkit: Semgrep, Weggli, ctags


Semgrep and weggli are not oracles. Given a kernel tree and no
architectural model in your head, they return thousands of
syntactically valid hits and zero insight. The tool amplifies a
hypothesis you already hold -- it does not generate the hypothesis.
Every pattern below exists because a researcher first answered the
hunting questions by hand, then wrote a query to scale that one
insight across a subsystem.


Structural question for Logical Engines: is cleanup symmetric to
allocation? The seams to audit, in priority order:


--------------------------------------------------------------------
1. Abort and rollback handlers -- least-tested paths in any
   transactional system, written under time pressure after the
   happy path is done.
--------------------------------------------------------------------
    semgrep: pattern = "goto $L; ... $L: ... free($OBJ)"
             (check state invariants hold before all goto targets)
    ctags:   ctags -R net/netfilter/ && grep "nft_abort\|_rollback" tags
    weggli:  weggli '{ _ $abort(...); free($obj); }' net/netfilter/

--------------------------------------------------------------------
2. Deactivation functions that differ from free functions -- check
   whether _deactivate() is always followed by _free().
--------------------------------------------------------------------
    semgrep: pattern-not "_free($OBJ)" following "_deactivate($OBJ)"
             in all paths

--------------------------------------------------------------------
3. Generation bitmask checks: current vs. next generation --
   nft_is_active() vs. nft_is_active_next(). Weggli cannot exclude
   calls natively, so pair it with grep -v:
--------------------------------------------------------------------
    weggli 'nft_is_active(_, _)' net/netfilter/ \
        | grep -v nft_is_active_next
    rule:   rules/semgrep/logical-engines/is-active-without-next.yml

--------------------------------------------------------------------
4. Union pointer stride mismatch: union { T1; T2; } *ptr where
   sizeof(T1) != sizeof(T2) -- the stride silently becomes
   sizeof(largest member) for every access.
--------------------------------------------------------------------
    rule: rules/semgrep/logical-engines/union-pointer-stride.yml

Triage scorecard once a candidate is found (extended scorecard in
the archive): +2 if the candidate lives in a different file than
the patched function, +1 if the subsystem had a kernel CVE in the
last two years, +1 if the fix landed in the last three releases.
Score >= 6: investigate. Score >= 8: prioritize. These coefficients
are a proposed heuristic encoding which signals were useful during
this work's triage, not a statistically validated model calibrated
against a labelled exploit/non-exploit dataset.


How much noise does each pattern produce? The benchmark runs in the
archive (validation/benchmark_results.md, Section 4) report: the
nft_is_active-without-_next pattern yields 9 low-false-positive
candidates; the io_uring multiple-SQE-read pattern yields ~300
functions needing per-function triage (moderate FP); broad array
access patterns yield ~2000 high-FP hits; and ~8 patterns do not
match at all due to weggli/semgrep expressiveness limits -- a real
false-negative source. These are triage signals, not verdicts.


To evaluate the classifier itself: python3 validation/run_validation.py --csv-text scores 67.7% on unseen CVE
text -- the honest figure. Treat it as a triage heuristic, not an
oracle.



--[ 6 - Case Study: nf_tables


"State is not a bug. Asymmetric state management is."



---[ 6.1 - Architecture: Netfilter Transaction Model


nf_tables [3] manages a hierarchy: tables contain chains; chains
contain rules; rules reference sets and objects. Every control-plane
change (add/delete a rule, element, or object) goes through a
two-phase commit: changes are staged, validated, then committed
atomically across a generation counter. Two independent code paths
can touch the same element: the netlink control plane (user-issued
transactions) and the garbage collector (async reclamation of stale
set elements). Both are expected to respect the generation counter.
Section 6.3 is what happens when one of them does not.



---[ 6.2 - Architectural Scatter (Independent Collapse):


CVE-2023-35001 and CVE-2024-1086


These two CVEs are not a bypass chain -- they demonstrate
Architectural Scatter: the same failure mode (an under-validated
numeric field) expressed independently at two isolated call sites.
Patching one did not touch the other.


CVE-2023-35001 [2] (NFT_BYTEORDER Union Alignment OOB)
    Date: July 2023 | Type: OOB Read/Write | Fixed: kernel 6.4.4

    [TRIGGER] nft_byteorder_eval() declares union { u32; u16 } *d at
    function scope. sizeof(union) is always 4 (the largest member),
    so pointer arithmetic on d[i] strides by 4 bytes regardless of
    which member the code intends to access. For priv->size == 2,
    the loop bound is priv->len/2, but d[i] still steps by 4 --
    with priv->dreg at byte offset 32 and len capped at 48, the loop
    runs 24 times and the last write reaches byte 125 -- roughly 46
    bytes past the 80-byte register file: an attacker-controlled OOB
    read/write in adjacent kernel stack memory.

    [ASSUMPTION] "priv->len bytes from the base register are
    sufficient to bound the access."
    [BLIND SPOT] The union's stride is 4 bytes, not 2. Fix: removed
    the union, used typed pointers directly.

CVE-2024-1086 [1][4] (Verdict Domain Confusion Double-Free)
    Date: January 2024 | Type: Use-After-Free
    Fixed: stable 6.7.3 / mainline 6.8-rc2, commit f342de4e2f33
    (backported to 6.6.15, 6.1.76, 5.15.149)

    [TRIGGER] nft_verdict_init() validates a verdict code by masking
    its lower 8 bits against NF_VERDICT_MASK, then falls through to
    treat anything matching as NFT_CONTINUE/BREAK/RETURN. The
    sequence that follows, confirmed against the revert commit's own
    rationale:

        1. Userspace sets a verdict whose low byte is NF_DROP, with
           an arbitrary value in the upper bits -- a field
           nf_hook_slow() expects to hold a negative errno (-EPERM,
           -EHOSTUNREACH) or 0.
        2. nft_verdict_init() never validates that upper-bits field;
           it only checks the low byte against NF_VERDICT_MASK.
        3. The verdict reaches nf_hook_slow(), which reads the
           upper bits as the drop error via NF_DROP_GETERR().
        4. A positive value there -- one that numerically resembles
           NF_ACCEPT (1) -- is misread as a non-error outcome
           instead of a genuine drop.
        5. The packet's skb is freed on the drop path, but the
           misread outcome causes a second free on the same skb
           downstream: a double-free, confirmed exploitable to a
           working root shell (Notselwyn, "Flipping Pages").

    [ASSUMPTION] "Masking against NF_VERDICT_MASK rejects all
    invalid verdict values."
    [BLIND SPOT] The mask only checks the lower 8 bits; the
    fallthrough accepts any value whose low byte happens to match.

Audit strategy: whenever any nf_tables CVE adds numeric-range
validation to one function, enumerate every other function in
nf_tables_api.c, nft_byteorder.c, nft_cmp.c, and nft_immediate.c
that accepts a user-controlled numeric field. Each is a candidate.



---[ 6.3 - Incomplete-Fix Variant: CVE-2023-4244 -> CVE-2024-1085


This pair IS an incomplete-fix variant -- but the causal chain is
subtler than "the fix missed a twin". CVE-2024-1085's own fix commit
states the bug was "uncovered after the recent removal of the
element busy mark (a2dd0233cbc4)", and its Fixes: tag points to
the 2021 commit that introduced catch-all set elements
(aaa31047a6d2) -- not to CVE-2023-4244's fix.
The asymmetric-generation check in nft_setelem_catchall_deactivate()
had been dormant since 2021, masked by the busy mark. CVE-2023-4244's
fix did not miss a twin of the function it patched; removing the
busy mark took away the mechanism that had been hiding an
unrelated, older bug. The mutation model still holds -- an
asymmetric state transition survived one fix and surfaced after
another -- but "exposed a pre-existing weakness" is the accurate
description, not "missed a twin".


CVE-2023-4244 [5] (UAF in GC Race)
    Date: September 2023 | Type: Use-After-Free | Fixed: kernel 6.5

    [TRIGGER] The GC asynchronously reclaims stale set elements via
    nft_setelem_data_deactivate() + nft_set_gc_batch_add(). Concurrent
    netlink processing can call nft_setelem_deactivate() on the same
    element. When these race, the element's bound data is released
    twice.
    [ASSUMPTION] "Generation locking protects concurrent element
    access."
    [BLIND SPOT] Generation locking protects visibility, not the
    refcount integrity of bound objects across independent
    deactivation paths.

    Fix: replaced the busy-mark mechanism with a gc_seq sequence
    counter, and removed the per-element busy mark entirely.
    [BLIND SPOT, again] Removing the busy mark exposed a latent bug
    in nft_setelem_catchall_deactivate() -- one that predates this
    fix by two years and was never a structural twin of anything
    CVE-2023-4244 touched.

CVE-2024-1085 [6] (Double-Free)
    Date: January 2024 | Type: Double-Free
    Fixed: kernel 6.7.2 (also backported to 6.6.14, 6.1.75, 5.15.148)

    [TRIGGER] nft_setelem_catchall_deactivate() checks
    nft_is_active() (current generation) instead of
    nft_is_active_next() (next generation):

    list_for_each_entry(catchall, &set->catchall_list, list) {
        ext = nft_set_elem_ext(set, catchall->elem);
        if (!nft_is_active(net, ext)) /* BUG */
            continue;
        /* deactivate and free the element ... */
    }

    Within a transaction this deactivates a still-live element and
    double-frees it.
    [ASSUMPTION] "A current-generation check is the correct semantic
    for this path -- the surrounding transaction logic will handle
    any edge case."
    [BLIND SPOT] It is not. Every sibling path uses
    nft_is_active_next(): the transaction path deactivates objects
    in the next generation, not the current one. This check was
    written before catch-all elements could be deactivated
    mid-transaction, and nobody revisited it when that became
    possible.

Run post-hoc against net/netfilter/ -- on Linux 7.1-rc1
(a8e7ef3cec99), a post-fix tree, so the rules locate the twin
function, not the vulnerable check -- the archive's semgrep rules
surface the twin in two complementary ways. The is-active-without-
next rule (rules/semgrep/logical-engines/is-active-without-next.yml)
flags nft_is_active() calls not paired with nft_is_active_next(): it
fires on nfnetlink_hook.c:141 and :173 (line numbers are for
7.1-rc1). The deactivation-without-free rule (rules/semgrep/
logical-engines/deactivation-without-free.yml) flags the exact twin:
nft_setelem_catchall_deactivate() at nf_tables_api.c:7011 (also
7.1-rc1), the catchall variant of nft_setelem_deactivate(). This is
the loop from Section 4 applied in practice: the rules confirm a
hypothesis a human forms by reading the GC diff, they do not form
it.



---[ 6.4 - From Candidate to Exploit


Both CVEs above produced working exploits (CVE-2023-35001: Synacktiv
PoC; CVE-2024-1086: Notselwyn's "Flipping Pages"). This paper stops
at candidate discovery; the exploitation reality is covered in
[2][4].



---[ 6.5 - Attacker's Takeaway: Where to Hunt Next


After any nf_tables patch:
    - Enumerate all functions operating on the same object type as
      the patched function.
    - Check for uniform generation checks (nft_is_active vs.
      nft_is_active_next) across every one of them.
    - Check for uniform locking in deactivation, rollback, and
      cleanup paths.
    - Check all user-controlled numeric fields in nf_tables_api.c,
      nft_byteorder.c, nft_cmp.c, nft_immediate.c.


--[ 7 - Limits: What the Framework Does Not Find


  • False positives: a candidate path may be unreachable due to
    mitigations (KASLR, CFI, refcount saturation). The scorecard in
    Section 5 is a triage aid, not a verdict.
  • False negatives: bypasses from cross-family interactions, or
    hardware-specific behavior, will not surface from a single-family
    classification.
  • The classifier's 67.7% figure (Section 5) is validated on 62
    sampled CVEs, mostly stateful kernel subsystems; a second
    "source-level" mode reports 85.5%, but that number is largely
    circular -- it maps every CVE to its subsystem's canonical file,
    so it measures the file, not the CVE. We have not validated it
    against a held-out, out-of-distribution CVE set.
  • Scope: this paper demonstrates the method on one Linux kernel
    subsystem. FreeBSD and XNU mappings are in the archive.


--[ 8 - Epilogue: The Pattern is the Weapon


One Architectural Scatter pair (Section 6.2) and one incomplete-fix
variant (Section 6.3), inside a single subsystem: enough to show the
shape of the problem without claiming more generality than one
subsystem earns. A fix that closes an observed trigger without
checking whether the same weakness survives elsewhere is not a fix,
it is a delay. The companion extended edition of this paper applies
this exact loop against eBPF's Predictive Oracles, io_uring's
Concurrent Proxies, and a five-CVE Windows authentication chain, to
show the same mutation surfacing across languages, vendors, and OS
models with no shared code between them.


Differential audit after every security patch: enumerate functions
operating on the same object type, and enforce uniform invariants
across every path. Do this and you are not hunting bugs anymore.
You are hunting the strain before it finds its next host.


All patterns, tools, and validation data are in a uuencoded archive
(Section 12): the 62-CVE dataset, precision/recall scripts, and the
semgrep/weggli rules referenced above.



--[ 9 - Acknowledgments


Julien "jvoisin" Voisin -- for the thorough technical review.
Nicolas "Newsoft" Ruff -- for the original "Security is failure"
talk at SSTIC and for the technical review.
The Phrack staff -- for two decades of raising the bar on what
offensive research looks like.


In memory of my parents, without whom none of this would exist:
Armel Kouhouenou (1974 - 31/03/2022), and
Julienne Kouchokeho (16 February 1977 - 18 September 2026).



--[ 10 - References


  1. CVE-2024-1086 -- patch commit f342de4e2f33
    https://nvd.nist.gov/vuln/detail/CVE-2024-1086
  2. CVE-2023-35001 -- Synacktiv (Tanguy Dubroca) writeup:
    https://www.synacktiv.com/publications/old-bug-shallow-bug-exploiting-ubuntu-at-pwn2own-vancouver-2023
  3. nf_tables kernel documentation
    https://docs.kernel.org/netlink/specs/nftables.html
  4. CVE-2024-1086 -- Notselwyn "Flipping Pages"
    https://pwning.tech/nftables/
  5. CVE-2023-4244 -- fix series merged as 3e91b0ebd994
    https://nvd.nist.gov/vuln/detail/CVE-2023-4244
  6. CVE-2024-1085 -- patch b1db244ffd04
    https://nvd.nist.gov/vuln/detail/CVE-2024-1085


--[ 11 - About the Author


Tedsig42 is an offensive security researcher focused on the gap
between patch intent and patch coverage -- the "what else did the
developer not look at?" question that turns a single CVE fix into
a family of bypasses.



--[ 12 - Attachments


All rules, the 62-CVE dataset, and validation scripts are included
as a uuencoded archive -- the decoded tree is the authoritative
source for every rule path and number cited above. The archive is
published with this article on the Phrack site; the full-length
edition (every-patch-is-a-guess-full.txt) additionally embeds it
verbatim at the end of the file, after the extended references and
the extended appendix.



--[ 13 - Extended Warm-Ups: Node.js and Apache MINA



---[ 13.1 - Warm-Up: Node.js Path Normalization (Predictive Oracle)


CVE-2025-23084 [18] -> CVE-2025-27210 [19] -> UNC bypass
(unassigned)


The function path.normalize() in Node.js analyzes a path string and
predicts that the result is safe to use for filesystem access. This
is a Predictive Oracle: analysis before execution, with a semantic
gap between what the predicate checks and what the OS actually does.


CVE-2025-23084 [18]: Node.js did not treat Windows drive names (C:,
D:) as special. path.join("C:..\sensitive") was parsed as a
relative path. But on Windows, "C:.." is relative to the current
directory on drive C. Result: escape from the intended subtree.


Fix: added drive-name validation.


CVE-2025-27210 [19]: the fix did not cover Windows reserved device
names (CON, PRN, AUX, NUL, COM1-9, LPT1-9). path.join("C:\", "CON",
"..\sensitive") passed the drive-name check and reached the root
filesystem through the device name.


The Windows kernel treats "CON" as a device file, not a directory
entry.


Fix: added device-name filtering.


UNC bypass (unassigned): after device names were blocked, UNC paths
(\\server\share\..\sensitive) remained valid. The oracle's
predicate still does not model all Windows path semantics.


Two mitigations in six months -- and a third gap, still unassigned.
Each fix closes one semantic gap.
Each bypass is the same vulnerability, mutated into the next
unvalidated path component. This is Architectural Scatter (Section
6.2) playing out across independent predicates in the same function,
and it is structurally identical to CVE-2020-27194 -> CVE-2021-3490
in the eBPF verifier (Section 14): different ecosystem, identical
architecture, identical mutation vector.



---[ 13.2 - Warm-Up: Apache MINA Deserialization (Logical Engine)


CVE-2024-52046 [20] -> CVE-2026-41409 [21] -> CVE-2026-42778 [22]
Apache MINA's ObjectSerializationDecoder uses Java native
deserialization to reconstruct objects from network data. The
deserialization process is a state machine: allocate -> initialize
-> resolve -> check. The bug is in the order of operations.


CVE-2024-52046 [20]: no classname filtering at all. Attacker sends a
crafted serialized stream -> arbitrary class instantiation -> RCE.


Fix: added allowlist with accept(ClassNameMatcher).


CVE-2026-41409 [21]: the allowlist check in
AbstractIoBuffer.getObject() ran after Java deserialization had
executed static initializers.
A class on the allowlist could still execute arbitrary code in its
static initializer before the security guard evaluated. The state
machine runs initialization before the security check -- an
asymmetric order of operations.


Fix: moved the check before initialization, released on all three
maintained branches (2.0.28, 2.1.11, 2.2.6).
CVE-2026-42778 [22]: that fix was complete on 2.0.x but still
incomplete on the 2.1.x and 2.2.x branches, which needed a second
round (2.1.12, 2.2.7). Same root cause, same static-initializer
timing flaw, different release line -- the mutation did not even
need a new code path this time. It just needed an unpatched branch.


This maps to the same pattern as nf_tables (Section 6): asymmetric
lifecycle management where the abort/init path is not synchronized
with the guard. The Windows Kerberos chain (Section 16) shows the
exact same Logical Engine mutation in a completely different
ecosystem: the authentication FSM (NTLM -> NEGOTIATE -> CHALLENGE ->
AUTHENTICATE) has asymmetric branches where reflection-detection is
enforced on some transitions (SMB loopback via mrxsmb.sys) but not
others (HTTP via Windows Admin Center, arbitrary-port SMB). Each
patch adds a guard to one branch without establishing the invariant
globally -- the same structure as the MINA 2.0.x / 2.1.x / 2.2.x
branching failure.


The hunting question is identical: "Is the fix applied to all
structurally equivalent state transitions, or only to the one where
the bug was observed ?"



--[ 14 - Extended Case Study: Predictive Oracles (eBPF/JIT)


"The verifier is not wrong. It is incomplete."



---[ 14.1 - Architecture: eBPF Verifier and JIT Pipeline


Every eBPF program passes through a static analyzer -- the verifier
-- before execution. The verifier builds an abstract model of the
program state: register types, value ranges (tnum), pointer
validity, and access permissions. If the model says "safe," the
program runs.


The gap is between the model and reality. The verifier's abstract
domain is a sound over-approximation in theory, but every missed
edge case creates a concrete path that the model did not anticipate.


eBPF implements two verifier passes. The first pass (check_cfg)
builds the control flow graph. The second pass (do_check) simulates
execution and tracks state at every instruction. State pruning
(regsafe) skips re-analysis of visited states if the current state
is a subset of the cached state.


The families converge here: the verifier is a Predictive Oracle. Its
pruning decisions act as a Logical Engine (state comparison).
Concurrent access to shared eBPF maps adds Concurrent Proxy risk.
This is the same convergence the JVM sandbox exhibited a generation
earlier (Section 18.9): a single component can be a Predictive Oracle
at the top of its call stack and a Logical Engine three frames down.



---[ 14.2 - Trigger A: CVE-2020-27194 [7] (ALU32 Bounds)


Date: August 2020
Type: Out-of-Bounds Read/Write
Fixed in: kernel 5.8.15
[TRIGGER] The 32-bit ALU operation scalar32_min_max_or() applied
64-bit bounds (smin_value/smax_value) to the result of a 32-bit OR
operation. After the operation, the verifier believed the register
held a 32-bit value in the range [0, 1], when the actual value (in
the upper 32 bits) was uncontrolled.


static void scalar32_min_max_or(struct bpf_reg_state *dst_reg,
    struct bpf_reg_state *src_reg)
{
/* Uses smin_value, smax_value, umin_value, umax_value
* (64-bit) instead of s32_min_value, s32_max_value,
* u32_min_value, u32_max_value (32-bit) */
    dst_reg->umin_value = ...; /* 64-bit bounds leak */
}

The fix switched to {u,s}32_min_value / {u,s}32_max_value for 32-bit
operations [commit 5b9fbeb75b6a].
[ASSUMPTION] "Using the same bounds fields for 32-bit and 64-bit
operations is safe because the verifier tracks register content by
type."
[BLIND SPOT] scalar32_min_max_or() is classified as a 32-bit helper
but uses 64-bit fields. After the operation, the verifier thinks the
register's value range is bounded by the 32-bit result. The actual
register (upper 32 bits) retains uncontrolled data from prior
operations.



---[ 14.3 - Trigger B: CVE-2021-3490 [8] (ALU32 XOR/AND)


Date: May 2021
Type: Out-of-Bounds Read/Write
Fixed in: kernel 5.13


[TRIGGER] The same bug class, two more victims. scalar32_min_max_xor()
and scalar32_min_max_and() both read and wrote 64-bit bounds fields
inside a 32-bit helper. The original patch for CVE-2020-27194 fixed
scalar32_min_max_or() but left and() and xor() untouched -- the
weakness did not need a new trigger, it simply walked next door:


ctags -R kernel/bpf/ && grep 'scalar32_min_max' tags


scalar32_min_max_and() and scalar32_min_max_xor() were NOT modified.
Both had the same bounds propagation flaw -- so did the
const-subreg OR case: CVE-2021-3490 covered all three (049c4e13714e).


[ASSUMPTION] "The CVE-2020-27194 fix covered all ALU32 operations."
[BLIND SPOT] The patch targeted the reported function
(scalar32_min_max_or) but not the structural twins (and, xor).


The semgrep rule for this pattern is in the included archive at
rules/semgrep/predictive-oracles/scalar32-bounds.yml. It flags any
scalar32_min_max_* function that reads or writes smin_value/
smax_value (64-bit fields) without also updating s32_min_value/
s32_max_value:


semgrep
--config rules/semgrep/predictive-oracles/scalar32-bounds.yml
path/to/linux-source/kernel/bpf/verifier.c


The rule would have caught scalar32_min_max_and() and
scalar32_min_max_xor() immediately after CVE-2020-27194 was fixed --
but only because a human first noticed that "32-bit helper, 64-bit
field" is the structural defect, not a syntactic one. Differential
audit (Section 18.3): after the CVE-2020-27194 commit, run ctags on
kernel/bpf/verifier.c, grep for 'scalar32_min_max', and verify each
function was updated with the 32-bit bounds fields.



---[ 14.4 - Structural Symmetry Bypass: CVE-2022-23222 [9] (OR_NULL)


Date: January 2022
Type: Privilege Escalation
Fixed in: kernel 5.16.11


[TRIGGER] adjust_ptr_min_max_vals() performs pointer arithmetic on
registers whose type is PTR_TO_ALLOC_MEM_OR_NULL. The verifier does
not reject pointer arithmetic on nullable types before the null
check. An attacker crafts a program where a register is marked
OR_NULL but arithmetic is performed as if the pointer were valid:



if (reg->type == PTR_TO_ALLOC_MEM_OR_NULL) {
/* BUG: no rejection of arithmetic on nullable */
    reg->smin_value += off;
    reg->smax_value += off;
}

The fix added a check: reject pointer arithmetic if
reg_type_may_be_null(reg->type) is true.


[ASSUMPTION] "If a register can be null, performing arithmetic on it
without checking null produces a valid pointer."
[BLIND SPOT] The fix only patched adjust_ptr_min_max_vals. Any other
function performing arithmetic on OR_NULL types without null-check
remains vulnerable.



---[ 14.5 - Structural Symmetry Bypass: CVE-2023-2163 [10] (State Pruning)


Date: September 2023 (discovered earlier, Google VRP)
Type: Arbitrary Read/Write, Container Escape
Fixed in: kernel 6.3 (backported to all stable trees)
CVSS: 10.0 (Google VRP)


[TRIGGER] regsafe() compares two verifier states to decide whether
pruning is safe. In its SCALAR_VALUE case, if the old register is
marked !precise it returns true (states equivalent) before the
range_within()/tnum_in() bounds comparison -- the shortcut assumes a
!precise register's bounds simply do not matter for pruning.


case SCALAR_VALUE:
...
if (!rold->precise)
    return true; /* prune: bounds "don't care" */
/* range_within()/tnum_in() run BELOW, only if
* rold->precise */
return range_within(rold, rcur) &&
tnum_in(rold->var_off, rcur->var_off);

The above is a pedagogical reconstruction of the logic flaw.
The actual kernel code (pre‑6.3) is more nested (involving helpers
like __reg_safe()), but the essential bug is the premature return
before bounds comparison-exactly as exploited in Google VRP's
CVE‑2023‑2163.


The attacker arranges a register that is marked !precise (the
verifier does not track its exact value) but whose bounds differ
between the old and current state. regsafe() says "same state" and
prunes the current path. The pruned path contains an out-of-bounds
access that the verifier never checks. The result is arbitrary
read/write in kernel memory.


[ASSUMPTION] "If precision tracking left a register !precise, its
bounds genuinely do not matter for pruning."
[BLIND SPOT] Precision was not propagated across conditional jumps,
so a register that DID matter could stay !precise -- and regsafe()'s
shortcut then prunes a path whose bounds were never checked.


The weggli rule for the pruning shortcut (Section 18.6, seam 2)
matches the construct (brace-less, as the kernel writes it):


weggli 'if (!$reg->precise) return true;'
path/to/linux-source/kernel/bpf/verifier.c


It fires on regsafe()'s SCALAR_VALUE case. The shortcut itself is
not the bug -- it still exists today (v7.0). The real fix, commit
71b547f56124, is in backtrack_insn(): it propagates precision across
conditional jumps (reg_mask |= sreg | dreg) so a register that
influences a precise one is itself marked precise, and is no longer
pruned away by the shortcut. A companion semgrep rule is at
rules/semgrep/predictive-oracles/imprecise-offset.yml.



---[ 14.6 - The Shock: CVSS 10.0 and the Irrelevance of KASLR


CVE-2023-2163 [10] gives the attacker arbitrary read/write in kernel
memory, and the CVSS 10.0 score -- the rating Google assigned as
CNA (NVD's primary metric is 8.8) -- is not inflation. State pruning
bypasses the bounds check, letting the attacker construct a program
where a register holds a kernel pointer disguised as a scalar. When
the program reads from that "scalar" offset, the kernel dereferences
the pointer and exfiltrates data to user space. KASLR is irrelevant
to this primitive: the vulnerability hands over arbitrary read that
leaks the kernel base directly, or arbitrary write that overwrites
specific structures regardless of their address.


Ubuntu Security described the practical consequence plainly: an
attacker can use this to crash the system or potentially run
arbitrary code.


The only mitigations that matter against this class are not the
usual heap-hardening suspects, they are access controls: BPF disabled
(CONFIG_BPF=n) or restricted to CAP_BPF, and lockdown mode
(CONFIG_SECURITY_LOCKDOWN_LSM). CFI blocks the most direct function
pointer overwrite paths but does nothing against data-only attacks --
cred overwriting, security pointer corruption -- which is exactly the
pivot an arbitrary read/write primitive invites. This is why KASLR
and CFI together are still insufficient against a CVSS 10.0 verifier
bypass: both mitigations assume the attacker needs to find an
address or hijack control flow. An arbitrary read/write primitive
needs neither.



---[ 14.7 - Attacker's Takeaway: Where to Hunt Next


  • ALU32 helpers not yet audited for 32-bit vs 64-bit bounds.
  • is_branch_taken() pruning decisions that check type but not
    bounds.
  • JIT backends for flag/truncation/overflow behavior diverging
    from the verifier model.
  • New BPF instruction classes (BPF_ATOMIC, BPF_LSM hooks,
    bpf_loop).

Targets worth auditing today:

  • BPF_LSM hooks
  • BPF_ATOMIC operations
  • Loop analysis for bpf_loop()
  • RISC-V JIT backend (less audited than x86-64 / arm64)


--[ 15 - Extended Case Study: Concurrent Proxies (io_uring)


"When every path is fast, which one is safe ?"



---[ 15.1 - Architecture: Submission Queue and Shared Memory


io_uring is a kernel interface for async I/O. The application and
kernel share two ring buffers in memory-mapped pages: the Submission
Queue (SQ) and Completion Queue (CQ). The application writes SQEs
(Submission Queue Entries) to the SQ; the kernel reads them,
executes the corresponding operations, and writes CQEs to the CQ.


The ring memory is shared between user and kernel space. The kernel
reads SQE fields with READ_ONCE() to handle concurrent modification.
Each READ_ONCE() of a concurrently-modifiable SQE field creates a
potential TOCTOU window.


As of Linux 6.6, io_uring exposes over 50 operation types, each with
independent submission, execution, and cleanup paths across multiple
source files. The architecture structurally guarantees that patching
any single path leaves parallel paths vulnerable -- fifty opcodes
sharing one architectural seam is fifty places the same bug can
relocate to.



---[ 15.2 - Architectural Scatter: CVE-2021-20226 -> CVE-2021-3491


CVE-2021-20226 [11] (NVD Feb 2021; fixed upstream Sep 2020):
io_grab_files() assigned the async worker's files_struct pointer
directly -- req->work.files = current->files -- without incrementing
the files_struct refcount. With files->count == 1, fdget() takes the
fast path __fget_light() which skips the atomic increment on the
struct file. A concurrent IORING_OP_CLOSE via the async worker frees
the file while another operation still holds a stale reference. UAF.


Fix: replaced the weak assignment with get_files_struct(current),
incrementing files->count so fdget() always takes the refcounting
path [commit 0f2122045b94].


CVE-2021-3491 [12] (NVD Jun 2021): IORING_OP_PROVIDE_BUFFERS
receives buffer addresses and lengths from userspace via the SQE.
The operation stores the length directly into io_buffer.len without
capping it to MAX_RW_COUNT. When the buffer is later accessed
through /proc/<PID>/mem, mem_rw uses the uncapped length, producing
negative values and a heap overflow. The fix added
buf->len = min_t(__u32, pbuf->len, MAX_RW_COUNT) [commit d1f82808877b]


[ASSUMPTION] "Fixing files_struct refcounting in io_grab_files()
fixes the class."
[BLIND SPOT] Both bugs are Concurrent Proxy vulnerabilities: the
submission queue carries user-supplied data (file descriptor in
CLOSE, buffer length in PROVIDE_BUFFERS) that crosses the trust
boundary without proper validation. But the specific mechanisms
differ -- one is a refcount leak, the other is a missing length cap.
A fix that addresses only one mechanism within the same
architectural family leaves other data paths unprotected -- the
weakness simply mutated from a refcount field to a length field,
inside the same ring.


The semgrep rules for the Concurrent Proxy family are in
rules/semgrep/concurrent-proxies/ (Section 18.2). The
fdget-refcount.yml rule flags fdget()/fget() calls (CVE-2021-20226
manifests through fdget()'s fast-path behavior; the rule identifies
sites where fdget/fget resource-lifecycle patterns need auditing).
The multiple-user-copy.yml rule flags functions that read the same
user buffer multiple times, creating a TOCTOU window. A value-range
audit after CVE-2021-20226 would additionally check every
user-supplied numeric field in each opcode's struct for missing
bounds capping. Running:


semgrep \
--config rules/semgrep/concurrent-proxies/ \
path/to/linux-source/io_uring/

flags fdget/fget sites for manual audit. The PROVIDE_BUFFERS
uncapped-length pattern requires a separate range-check rule not yet
in the rule set. After the io_grab_files() fix, PROVIDE_BUFFERS
remained unpatched because neither a fdget audit nor a value-range
audit had been applied to io_uring as a whole -- differential audit
across all SQE data paths surfaces the second bug in minutes.



---[ 15.3 - Structural Symmetry Bypass: CVE-2023-2598 -> CVE-2024-0582


CVE-2023-2598 [13] (May 2023): io_sqe_buffer_register() takes a
userspace-provided iov and registers it as a fixed buffer. The
function has a fast path for compound pages: when PageCompound() is
true, it assumes physical contiguity and creates one bio_vec for the
entire range. An attacker maps the same physical page at two
consecutive virtual addresses, satisfying the compound-page check
without physical contiguity. The result: OOB read/write when I/O
assumes the buffer covers 2 pages of physical memory.


Fix: removed the compound-page fast path. Every registered buffer
now uses one bio_vec per physical page.


BLIND SPOT: the fix only affected fixed buffer registration in
rsrc.c. The Provided Buffer Ring (IORING_REGISTER_PBUF_RING) in
kbuf.c has its own lifecycle and was not audited -- the same
compound-buffer weakness simply relocated to a sibling subsystem
that happened to be out of scope for the first patch.


CVE-2024-0582 [14] (fixed December 2023, disclosed January 2024,
found by Google Project Zero): a PBUF ring registered with
IOU_PBUF_RING_MMAP is allocated by the kernel and mmap()'d into user
space. On IORING_UNREGISTER_PBUF_RING the kernel frees those pages
back to the allocator without checking that user space has unmapped
them. The user mapping survives, so the application keeps read/write
access to pages that can be reallocated for other kernel objects:


T0: Register MMAP PBUF ring -> kernel allocs pages, app mmap()s
them
T1: Unregister PBUF ring -> pages freed to the allocator, but
the user mapping is NOT torn down
T2: Allocator reuses the freed pages for a new kernel object
(spray with controlled content)
T3: App reads/writes through its stale mapping -> read/write on
the reallocated kernel object


[ASSUMPTION] "Hardening fixed-buffer registration prevents OOB on
all buffer mechanisms."
[BLIND SPOT] PBUF rings use a separate code path (kbuf.c) with an
independent register/unregister lifecycle; the mmap variant frees
pages the user still has mapped.



---[ 15.4 - The Shock: Freeing Pages the User Still Owns


A use-after-free where the "use" is an ordinary userspace memory
access through a mapping the kernel itself created is about as
direct as a primitive gets, and CVE-2024-0582 [14] was exploited in
Google kCTF and documented by Exodus Intelligence in "Mind the Patch
Gap." Modern mitigations raise the bar without closing the gap:
CONFIG_RANDOM_KMALLOC_CACHES (Linux 6.6+) [16] creates 16 independent
copies of each kmalloc cache, selected by the allocation's code
address, so the attacker cannot deterministically land their spray
object in the same cache as the freed PBUF ring pages.
CONFIG_SLAB_FREELIST_RANDOM [15] randomizes the order of free objects
within each slab, preventing deterministic reuse.


io_uring's structural advantage for an attacker undercuts both: the
ring accepts thousands of concurrent SQEs that allocate and free
objects of the same kmalloc bucket. Under the pigeonhole principle,
with 16 independent kmalloc cache copies and more than 16 distinct
call‑site addresses, a theoretical upper bound of 100% collision
rate exists. Our simulation (test_kmalloc_collision.c) confirms
this bound under ideal conditions. In practice, cache selection
policies may reduce or skew this rate, but the flood vector remains
a powerful primitive for heap spraying.


gcc -O2 -o test_kmalloc_collision \
validation/scripts/test_kmalloc_collision.c -lm
./test_kmalloc_collision
# expects: 100% collision rate

Full results: validation/results/07-kmalloc-collision.md. The
kvmalloc seed bug (pre-6.15/7.0.0) [17] made this easier
historically. Whether this translates into a reliable exploitation
primitive on a given target still depends on kernel version and
mitigation configuration -- this is a triage observation, not a
universal exploit technique (Section 5's scorecard is how you
decide). What is not in question: working exploits for CVE-2024-0582
exist on recent kernels, confirming that mitigations slow but do not
stop a determined attacker who treats the ring itself as the spray
engine.



---[ 15.5 - Attacker's Takeaway: Where to Hunt Next


  • io_uring multishot operations
  • vhost-net virtqueue handling
  • Intel i915 GPU command buffer submission
  • AF_XDP zero-copy socket buffers


--[ 16 - Cross-Domain Proof: Windows Authentication Reflection Chain


Sections 6, 13, 14, and 15 have already shown this chain's fingerprints
inside Node.js, Apache MINA, and the Linux kernel: the three
families are not Linux-specific artifacts, they are the same
computer-science invariant from Section 18.9 recurring everywhere a
system manages lifecycles, predicts safety, or shares memory. This
section is the closing proof, in a domain with no shared code, no
shared maintainers, and no shared language with the kernel subsystems
above -- Active Directory authentication.



---[ 16.1 - Architecture: Windows Authentication FSM


Windows authentication is a state machine with multiple paths:


NTLM -> NEGOTIATE -> CHALLENGE -> AUTHENTICATE
Kerberos -> AS-REQ -> AS-REP -> TGS-REQ -> TGS-REP -> AP-REQ
SMB -> Session Setup -> Tree Connect -> IO


Each protocol can trigger the authentication state machine at
different entry points. The reflection detection logic (loopback
check) was added incrementally, one protocol at a time, without
establishing a universal invariant -- the same incremental,
per-branch patching that left MINA's 2.1.x and 2.2.x branches exposed
after 2.0.x was fixed (Section 13.2).



---[ 16.2 - Five CVEs, One Root Cause


All five CVEs below share a root cause: Windows authentication
reflection detection is incomplete across protocols. Each patch adds a
guard to one component without establishing the invariant globally --
five generations of the same mutation, never the same trigger twice.


CVEComponentYearDescription
CVE-2025-33073 [23]mrxsmb.sys2025SMB client CMTI reject
CVE-2025-58726 [24]Ghost SPNs2025SPN re-auth on relay
CVE-2026-24294 [25]SMB/arb.2026Port-indep. loopback check
port
CVE-2026-26128 [26]SMB Server2026Homoglyph detect, DnsCache
CVE-2026-26119 [27]WAC/HTTP2026EPA enforcement for WAC

CVE-2025-33073: the June 2025 patch makes the SMB client
(mrxsmb.sys) refuse connection attempts whose target name carries
additional target information -- the marshalled
CREDENTIAL_TARGET_INFORMATION (CMTI) trick that spawns a local
NTLM handshake or a sanitized SPN. BLIND SPOT: killing one coercion
trick does not fix the root cause -- receiving a local
authentication on a controlled listener and relaying it back still
works through other primitives.


CVE-2025-58726: Ghost SPNs abuse domains where the SPN was deleted
but the service account still exists. An attacker coerces
authentication to a deleted SPN, and the KDC issues a ticket for the
old SPN.


CVE-2026-24294: local NTLM reflection -- a local SMB server on an
arbitrary TCP port receives LSASS's NTLM handshake and relays it
back to the machine's own SMB service (Synacktiv, April 2026).
CVE-2026-26128: SMB Server EoP via a DNS homoglyph -- the KDC applies
Unicode normalization that DnsCache does not. An attacker registers
"SRV1.AD.LOCAL" with a homoglyph capital letter (punycoded SPN) --
gets a valid ticket for SRV1$ via the homoglyph SPN.


CVE-2026-26119: Windows Admin Center improper authentication logic
allows low-privileged users to escalate privileges by bypassing
authentication context validation, gaining access as the WAC
service account (often Domain Admin).



---[ 16.3 - The Framework Maps Cleanly


This chain maps to two families simultaneously -- proof that the
families converge in Windows exactly as they converged in the eBPF
verifier (Section 14.1):
Concurrent Proxy failure: patching one protocol path (SMB) leaves
structurally equivalent paths open (HTTP, raw Kerberos over TCP).
This is the same pattern as io_uring's parallel buffer mechanisms
(Section 15).


Logical Engine failure: the authentication FSM has asymmetric
branches where reflection-detection is enforced on some transitions
(NTLM, SMB loopback) but not others (Kerberos, HTTP).


Question 4 (Section 4) applied to CVE-2025-33073: "Are there other
coercion paths not covered by the mrxsmb.sys patch ?" immediately
surfaces Ghost SPNs, arbitrary-port SMB, homoglyph DNS, and HTTP
endpoints. All four were found by researchers within twelve months
of the original patch -- the same twelve-to-eighteen month mutation
window observed in every Linux case study above. The strain does not
care which kernel, or which company, wrote the host it is living in.



--[ 17 - Extended References


  1. CVE-2020-27194 -- patch commit 5b9fbeb75b6a
    https://nvd.nist.gov/vuln/detail/CVE-2020-27194

  2. CVE-2021-3490 -- ZDI-21-325 (Manfred Paul)
    https://nvd.nist.gov/vuln/detail/CVE-2021-3490

  3. CVE-2022-23222 -- patch commit 64620e0a1e71
    https://nvd.nist.gov/vuln/detail/CVE-2022-23222

  4. CVE-2023-2163 -- Google VRP, patch commit 71b547f56124
    https://nvd.nist.gov/vuln/detail/CVE-2023-2163
    https://bughunters.google.com/blog/6303226026131456/

  5. CVE-2021-20226 -- patch commit 0f2122045b94
    https://nvd.nist.gov/vuln/detail/CVE-2021-20226

  6. CVE-2021-3491 -- patch commit d1f82808877b
    https://nvd.nist.gov/vuln/detail/CVE-2021-3491
    [13] CVE-2023-2598 -- patch commit 776617db78c6
    https://nvd.nist.gov/vuln/detail/CVE-2023-2598

  7. CVE-2024-0582 -- Google Project Zero, patch commit c392cbecd8ec
    https://nvd.nist.gov/vuln/detail/CVE-2024-0582
    https://bugs.chromium.org/p/project-zero/issues/detail?id=2504
    https://blog.exodusintel.com/2024/03/27/mind-the-patch-gap/

  8. CONFIG_SLAB_FREELIST_RANDOM
    https://www.kernelconfig.io/CONFIG_SLAB_FREELIST_RANDOM

  9. CONFIG_RANDOM_KMALLOC_CACHES
    https://www.kernelconfig.io/CONFIG_RANDOM_KMALLOC_CACHES

  10. Linux 6.15 cache randomization seed fix
    https://www.phoronix.com/news/Linux-6.15-slab

  11. CVE-2025-23084 -- Node.js drive name path traversal
    https://nvd.nist.gov/vuln/detail/CVE-2025-23084
    https://nodejs.org/en/blog/vulnerability/january-2025-security-releases

  12. CVE-2025-27210 -- Node.js device name path traversal bypass
    https://nvd.nist.gov/vuln/detail/CVE-2025-27210
    https://nodejs.org/en/blog/vulnerability/july-2025-security-releases
    [20] CVE-2024-52046 -- Apache MINA ObjectSerializationDecoder RCE
    https://nvd.nist.gov/vuln/detail/CVE-2024-52046
    https://lists.apache.org/thread/4wxktgjpggdbto15d515wdctohb0qmv8
    [21] CVE-2026-41409 -- Apache MINA allowlist timing bypass
    https://nvd.nist.gov/vuln/detail/CVE-2026-41409
    https://lists.apache.org/thread/9ddvsq6c4l5bhwq8l14sob4f8qjvx5c9

  13. CVE-2026-42778 -- Apache MINA cross-branch incomplete fix
    https://nvd.nist.gov/vuln/detail/CVE-2026-42778
    https://lists.apache.org/thread/fhlx5k91hrkgyzh7yk1nghrn3k27gxy0

  14. CVE-2025-33073 -- Windows SMB Kerberos reflection (Synacktiv)
    https://nvd.nist.gov/vuln/detail/CVE-2025-33073
    https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-33073
    https://www.synacktiv.com/en/publications/ntlm-reflection-is-dead-long-live-ntlm-reflection-an-in-depth-analysis-of-cve-2025

  15. CVE-2025-58726 -- Ghost SPNs (Semperis/Andrea Pierini)
    https://nvd.nist.gov/vuln/detail/CVE-2025-58726
    https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-58726
    https://www.semperis.com/blog/exploiting-ghost-spns-and-kerberos-reflection

  16. CVE-2026-24294 -- Windows SMB arbitrary port loopback
    https://nvd.nist.gov/vuln/detail/CVE-2026-24294
    https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-24294
    https://www.synacktiv.com/en/publications/bypassing-windows-authentication-reflection-mitigations-for-system-shells-part-1
    [26] CVE-2026-26128 -- Windows SMB homoglyph DNS (Synacktiv)
    https://nvd.nist.gov/vuln/detail/CVE-2026-26128
    https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-26128
    https://www.synacktiv.com/en/publications/bypassing-windows-authentication-reflection-mitigations-for-system-shells-part

  17. CVE-2026-26119 -- Windows Admin Center EPA bypass
    https://nvd.nist.gov/vuln/detail/CVE-2026-26119
    https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-26119
    https://www.semperis.com/blog/windows-admin-center-remote-priv-esc-cve-2026-26119



--[ 18 - Extended Appendix



---[ 18.1 - Why the Parser Chokes: AST Limits in Kernel Code


Before trusting a static-analysis hit -- or trusting its silence --
understand why an Abstract Syntax Tree built from kernel C is
already a degraded model of the program before you write a single
rule against it:


Macro expansion
container_of(), list_for_each_entry(), READ_ONCE(), and the
netfilter generation-mask helpers are all macros. A parser that
works on pre-processor output sees the expanded form and loses
the semantic intent ("this is a generation check") behind
syntax noise ("this is a comparison of two integer
expressions"). A parser that works on raw source sees the macro
invocation but cannot, without a full preprocessor model, see
what it expands into. Either way, a rule written at the wrong
layer either matches everything or matches nothing.


Type inference collapse
void * and union members erase the type information a
differential audit needs most. CVE-2023-35001 (Section 6.2)
is invisible to any tool that asks "does this pointer arithmetic
respect the pointee's size ?" -- because the union's declared
size IS sizeof(u32), and the arithmetic IS correct for that
type. The bug is not a type error. It is a human architectural
fact (this code intends to stride by 2 bytes sometimes) that no
AST node encodes.
Conditional concurrent primitives
Whether mutex_lock(&x->lock) on one path and the absence of that
call on a parallel path constitutes a race depends on whether
both paths are reachable concurrently -- a property of the
scheduler, the call graph, and the subsystem's locking
discipline, none of which live in a single function's AST. A
parser sees two independent functions. A researcher who has
read the locking comments three call sites up sees a race.


Indirect call lineage through function pointers
struct file_operations, the eBPF helper dispatch table, and
io_uring's per-opcode issue/cleanup function pointers all
resolve their target at runtime. Static data-flow tracking that
is precise for direct calls degrades to "could be any of these
N functions" the moment it crosses an indirect call -- and the
Concurrent Proxy family (Section 18.2) lives almost entirely on
the far side of exactly this kind of dispatch table.


None of this is a reason to distrust the tools.
It is the reason every rule in Sections 18.2 through 18.6 is described
first as a structural question a human answers, and only second as a
query string. The tool's job is to take an insight that took an
afternoon of reading to form and apply it to forty thousand lines of
C in under a minute. That is amplification, not substitution.



---[ 18.2 - Family-Specific Seams: Concurrent Proxies


Structural question: Where has a performance optimization removed a
barrier the security model depended on?


Seams to audit:


  1. Recently added "fast path" code
    git log --all --since="2024-01-01"
    --grep="fast path|optimize|avoid lock|zero-copy"
    -- io_uring/ drivers/ | head -30

  2. Functions that read from user-accessible memory more than once
    semgrep: rules/semgrep/concurrent-proxies/multiple-sqe-reads.yml
    weggli: weggli '{ READ_ONCE($sqe->_); READ_ONCE($sqe->_); }'
    io_uring/

  3. fget()/fdget() in async issue functions without matching
    fput()/fdput()
    semgrep: rules/semgrep/concurrent-proxies/fdget-refcount.yml
    weggli: weggli 'fget(_)' io_uring/



---[ 18.3 - Differential Patch Auditing (Complete Reference)


Section 4 introduced the three-step loop. This section gives the
full command workflow for each step.


Step 1: IDENTIFY THE ADDED CODE
Every added line encodes an assumption.


+ if (condition) return -EINVAL;
-> Are there other entry points without this check?
+ mutex_lock(&x->lock);
-> Are there other paths accessing x without this lock?
+ if (!nft_is_active_next(net, x)) continue;
-> Are there other functions still using the current-gen
check?

Step 2: FIND PARALLEL CODE NOT MODIFIED
Search for functions operating on the same data structure that
perform similar operations (_deactivate, _destroy, _free).


Practical workflow:


# Extract the patch
git show <fix_commit> > fix.patch
grep "^+" fix.patch | grep -v "^+++" | head -40

# Find the patched structure
grep "^+" fix.patch | grep "struct\|->use\|->refcount\|genmask"

# Find structural twins
ctags -R net/netfilter/ && grep 'nft_setelem' tags

# Check if they have the same fix
weggli 'nft_is_active_next(_, _)' net/netfilter/nf_tables_api.c


---[ 18.4 - Quick-Reference: Tool Patterns by Family


FAMILYToolPattern / query
Logical Enginesemgrep_deactivate() not followed by _free()
weggli'{_deactivate($OBJ); ... free($OBJ);}'
coccirules/cocci/find-un-active.cocci
ctagsgrep 'genmask|_is_active\b' in tags
git grepnft_is_active[^_] (without _next)
Predictivesemgrepscalar32 helpers: smin_value (64-bit)
Oracleweggli'if (!reg->precise) { return true; }'
ctagsgrep ALU32|subreg|OR_NULL in verifier
JIT dump/proc/kallsyms (via
/proc/sys/net/core/bpf_jit_kallsyms)
Concurrent Proxysemgreptwo reads of sqe->$F in same function
weggli'READ_ONCE($sqe->_); READ_ONCE($sqe->_)'
ctagsgrep 'fdget|fget|io_cancel' in tags
git log--grep="optimize|fast path|avoid lock"


---[ 18.5 - Family-Specific Seams: Logical Engines


Structural question: Is cleanup symmetric to allocation ?


Seams to audit:


  1. Abort and rollback handlers
    Least-tested paths in any transactional system. Written under
    time pressure after the happy path is complete.

    semgrep: pattern = "goto $L; ... $L: ... free($OBJ)"
    (check if state invariants hold before all goto targets)

    ctags:

    ctags -R net/netfilter/ && 
    grep "nft_abort\|_rollback\|_undo" tags

    weggli:

    weggli '{ \_ $abort(...); free($obj); }' net/netfilter/
  2. Deactivation functions that differ from free functions
    Check whether _deactivate() is always followed by _free().

    semgrep: pattern-not: "_free($OBJ)" following
    "_deactivate($OBJ)" in all paths

  3. Generation bitmask checks: current vs next
    nft_is_active() vs nft_is_active_next()

    weggli: (weggli cannot exclude function calls natively; use grep -v as workaround)

    weggli 'nft_is_active(_, _)' net/netfilter/ | grep -v nft_is_active_next

    semgrep: rules/semgrep/logical-engines/is-active-without-next.yml
    coccinelle: rules/cocci/find-un-active.cocci
    semgrep: rules/semgrep/logical-engines/union-pointer-stride.yml

  4. Union pointer stride mismatch
    union { T1; T2; } *ptr where sizeof(T1) != sizeof(T2)

    semgrep: rules/semgrep/logical-engines/union-pointer-stride.yml



---[ 18.6 - Family-Specific Seams: Predictive Oracles


Structural question: Does the Oracle track all dimensions of the
domain it claims to verify?


Seams to audit:


  1. ALU32 helpers using 64-bit bounds
    semgrep: flag functions named scalar32_* that do not update
    both s32_{min,max}_value and u32_{min,max}_value

weggli: weggli 'scalar32_min_max_and(_, _)'
kernel/bpf/verifier.c


  1. State pruning shortcuts
    semgrep: flag paths where !precise skips bounds comparison

weggli: weggli 'if (!reg->precise) return true;'
kernel/bpf/verifier.c


  1. JIT-verifier divergence
    Compile BPF program, extract JIT output via
    /proc/kallsyms (enabled via
    /proc/sys/net/core/bpf_jit_kallsyms), and compare native code
    against the verifier's model for specific sequences.


---[ 18.7 - The Hunting Checklist


Question 1: What family is this ?
Classify as Logical Engine, Predictive Oracle, or Concurrent
Proxy. If you cannot classify it, you do not yet understand the
architecture well enough to hunt in it.


Question 2: What is the nominal path, and what are the exceptional
paths ?
For each exceptional path (abort, cancellation, unusual encoding,
concurrent modification), does the code maintain the same
invariants as the nominal path ?


Question 3: What does each function assume about the state it
receives ?
Read the first ten lines of each function in the audited path.
Write down the implicit preconditions. Is there any caller that
does not satisfy them ?


Question 4: Is the fix symmetric ?
If the patch adds a check to function X, list all functions in
the same file with the same structural role. Were they also
patched? This is the single most productive question for CVE
bypass discovery. It found CVE-2024-1085 and CVE-2024-0582.


Question 5: What changed recently for performance?
For Concurrent Proxies: commits mentioning "optimize", "fast
path", "avoid lock", "amortize", "batch" -- each removed a
barrier. For Predictive Oracles: commits adding new instruction
classes. For Logical Engines: commits adding new operation or
object types.



---[ 18.8 - Triage: Separating Candidates from Exploits


Bypass candidates are not exploits. Use this scorecard to prioritize
-- and to decide which strain is worth following into its mutation,
detailed live in Sections 6, 14, and 15:


+1 if: Subsystem had kernel CVE in last 2 years
+1 if: >20 commits/month in subsystem
+1 if: Fix is in last 3 releases
+2 if: Twin is in a different file (harder for reviewer to notice)
+1 if: semgrep severity=WARNING
+2 if: semgrep severity=ERROR
+1 if: Bug had working PoC


Score >= 6: investigate
Score >= 8: prioritize


Before building a PoC, verify:

  • Can you trace a path from userspace to the candidate function ?
  • Is it reachable with unprivileged permissions ?
  • Does the unpatched path exist in the same kernel build ?
  • Is there a CONFIG option disabling the vulnerable path ?

In practice, exhaustive twin auditing is rarely feasible. We
recommend the following triage shortcut :


  • Prioritize functions reachable from unprivileged userspace
    (io_uring, bpf, netlink).

  • Ignore static functions called from a single site unless they
    handle attacker‑controlled data.

  • For Logical Engines, prioritize abort and rollback paths
    before commit paths-they are historically undertested.

  • If a twin is in a different file (e.g., rsrc.c vs kbuf.c),
    escalate its priority (+2 in the scorecard).


Abandon if:

  • Candidate is static, called from one site only
  • Patch explicitly mentions the candidate
  • Candidate is in __init code (runs only at boot)
  • The candidate path is disabled by default

The detailed Mitigation Reality analyses for each family are now
integrated directly into the corresponding case study sections:
see Sections 6.5 (nf_tables), 14.7 (eBPF), and 15.5 (io_uring).



---[ 18.9 - The Historical Invariant


This is not a 2020s novelty. The same three failure modes-asymmetric
state, incomplete static analysis, and racing proxies-have driven
sandbox escapes for two decades (Java SecurityManager, bytecode
verifier, ClassLoader confusion). Distributed state desynchronization
is not an io_uring invention; it is computer science's oldest
architectural seam, wearing a kernel module.


This is why the framework in Sections 2 through 4 is not a taxonomy of
CVEs. It is a taxonomy of the boundary conditions every stateful system
has always had, going back to the first multi-user operating system that
ever had to decide whether a half-finished operation could be safely
rolled back.



---[ 18.10 - The Hunting Questions


Before reading a single line of kernel code, ask:


Q1: Does it manage objects with explicit lifecycles?
-> Logical Engine
Q2: Does it analyze or transform input before execution?
-> Predictive Oracle


Q3: Does it rely on shared memory with minimal synchronization?
-> Concurrent Proxy


These three questions successfully map every CVE in our sampled
dataset
(62 CVEs, primarily from stateful kernel subsystems) to
one of the three families. We treat this as a search heuristic,
not a formal partition-some bugs (e.g., simple NULL dereferences or
information leaks) may not fit cleanly. If you cannot classify a
component, you do not yet understand its architecture well enough to
hunt in it.



---[ 18.11 - What the Framework Does Not Find


The framework identifies structural bypass candidates, not confirmed
exploitable vulnerabilities. Honest limitations:


  • False positives: a candidate path may be unreachable due to
    mitigations (KASLR, CFI, refcount saturation). Section 5
    provides a triage scorecard.

  • False negatives: bypasses from complex cross-family interactions
    or hardware-specific behavior may not surface from single-family
    classification.

  • Taxonomy overlap: the families are not mutually exclusive. The
    classification is a search heuristic, not a formal partition.

  • Scope: the framework was developed against Linux kernel
    subsystems. The Windows Kerberos chain (Section 16) provides
    cross-domain validation. FreeBSD (dhclient CVE-2026-42511, NFS
    CVE-2026-4747) and XNU (IOKit IOUserClient, Mach IPC) mappings
    are documented in cross-kernel/ in the  included archive.



---[ 18.12 - Fix Analysis


The patch replaces the old gc_batch mechanism with a new GC
transaction API: a gc_seq sequence counter lets the work queue
detect when the control plane has touched an element, and the
per-element "busy mark" is removed.


[ASSUMPTION] "The new gc_seq transaction API closes the GC vs
control-plane double-free window."
[BLIND SPOT] Removing the busy mark exposed a latent twin --
nft_setelem_catchall_deactivate() -- still using the current-gen
check. The vulnerability did not close. It mutated sideways into the
one function nobody re-audited after the GC rework.



---[ 18.13 - Why the Fix Was Incomplete


nft_setelem_catchall_deactivate() performs semantically equivalent
operations on the same object type as the patched paths, but used
nft_is_active() (current generation) instead of nft_is_active_next().


The CVE-2023-4244 GC rework that removed the busy mark is what
exposed it. Textbook structural twin: find the patched function,
locate its twins, audit them for the same missing invariant.
The semgrep rule for this exact pattern is
rules/semgrep/logical-engines/is-active-without-next.yml in the
archive at Section 12.
Running it against net/netfilter/ flags
every call site using nft_is_active() (current-generation check)
that is not paired with nft_is_active_next() -- which is how
nft_setelem_catchall_deactivate() was found as a structural twin:


semgrep \
--config \
rules/semgrep/logical-engines/is-active-without-next.yml \
path/to/linux-source/net/netfilter/

The rule fires on nft_setelem_catchall_deactivate() and returns a
severity=WARNING hit with message: "Using nft_is_active() instead of
nft_is_active_next(). This was the root cause of CVE-2024-1085."
This is the differential audit loop (Section 4) applied in
practice: nft_is_active_next() is the predicate the transaction
paths already use, and the rule finds every site still on the bare
current-generation check. The rule confirms the hypothesis a human
already formed by reading the GC rework diff -- it does not form
the hypothesis itself (Section 18.1).



---[ 18.14 - The Shock: From Bug to SLUB Corruption


A structural twin is an architecture diagram. A double-free in a
live kernel allocator is a weapon, and the two CVEs above are not
theoretical: both produced working exploits (CVE-2023-35001 [2]:
Synacktiv PoC; CVE-2024-1086 [1][4]: Notselwyn "Flipping Pages").


KASLR is not a barrier for either. The OOB read in nft_byteorder
(CVE-2023-35001) can leak return addresses or heap pointers straight
out of kernel stack memory, handing the attacker runtime addresses
directly -- there is no base address to hide when the bug reads past
the register into whatever happens to sit next to it. The double-free
in CVE-2024-1086 corrupts the SLUB allocator's freelist pointer
directly, and a corrupted freelist is not a crash, it is a redirect:
the next allocation of that size class lands wherever the attacker's
forged freelist pointer says it should.


CONFIG_SLAB_FREELIST_RANDOM [15] and CONFIG_RANDOM_KMALLOC_CACHES
(Linux 6.6+) [16] make deterministic heap spray harder by randomizing
freelist order and creating 16 independent kmalloc cache copies.
These mitigations raise complexity but do not eliminate it -- the
attacker can still spray via nf_tables transactions that allocate
elements of the same kmem_cache, because the ring of transactions
itself is the spray primitive. CFI (CONFIG_CFI_CLANG) blocks the
most direct control-flow hijack paths, which only narrows the exit:
an attacker who achieves a write primitive pivots to data-only
targets -- cred structures, security pointers -- that CFI was never
designed to protect, because CFI checks where you jump, not what you
overwrite on the way there.


The bottom line: these are not "in vitro" vulnerabilities. Every CVE
in this case study has a known exploit or writeup demonstrating
practical impact, and the mitigation stack slows the strain without
sterilizing it.



every-patch-is-a-guess.tar.gz


|=[ EOF ]=---------------------------------------------------------------=|