Last active
September 23, 2026 15:29
-
-
Save roycewilliams/2de9b14fa6160300729b98fe300bf854 to your computer and use it in GitHub Desktop.
Yara for detecting tac_plus versions vulnerable to 2026-09 vulnerability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * tac_plus_fmtstring.yar - tac_plus pre-auth format string bug (elttam, | |
| * 2026-09-23; CVE pending). Fixed in Shrubbery F4.0.4.32. | |
| * Generated by Claude Opus 4.8 on 2026-09-23. Tested with yara 4.2.3. | |
| * Version: 2026-09-23.02 (base = YYYY-MM-DD, .NN = same-day revision; bump all rules together) | |
| * Validated 2026-09-23 against real stripped binaries: Debian(Shrubbery), | |
| * EPEL(Meta,glibc), OpenWrt(Meta,musl), and Shrubbery's own compiled F4.0.4.32 | |
| * (patched -> family only, not vuln). Anchors are runtime strings; the Cisco | |
| * copyright is a source comment and absent from binaries, so it is NOT used. | |
| * IFIN: https://ifin.network/t/cve-pending-pre-auth-format-string-bug-in-tac-plus-shrubbery-networks/859 | |
| * Advisory: https://github.com/elttam/publications/blob/master/writeups/elttam-tac_plus_rce_fmtstring_advisory.txt | |
| * | |
| * Approach: the compiled fix has no reliable signature, so we identify the code | |
| * family, then gate on the version string (a .rodata constant that survives | |
| * strip). The gate is a numeric range F4.0.4.0 .. F4.0.4.31, so future patched | |
| * builds (.32+) never match; edit the one regex if the fixed version moves. | |
| * | |
| * Limitations: | |
| * - Stripped/renamed version -> version rule misses it; tac_plus_devkit_family | |
| * still fires. Treat family-only hits as "unknown version, triage", not safe. | |
| * - Backported fix under an old version string -> false positive. Only | |
| * source/build inspection sees a backport. Confirm before you alarm. | |
| * - Scan COMPILED artifacts, not source: a source tree/changelog carries old | |
| * version numbers (the patched F4.0.4.32 tarball's own spec/CHANGES trip the | |
| * version rule). Use *_vuln_elf for ELF, or exclude text in your wrapper. | |
| * - Marc Huber's tac_plus / tac_plus-ng shares Cisco ancestry (same copyright + | |
| * send_authen_error symbol) but is NOT affected (source review 2026-09-23) and | |
| * is disambiguated on Huber-only markers (mavis/spawnd/tac_plus-ng/Marc Huber). | |
| * tac_plus_huber_rewrite tags it; vulnerable rules exclude those markers. | |
| */ | |
| rule tac_plus_huber_rewrite | |
| { | |
| meta: | |
| description = "Marc Huber event-driven tac_plus / tac_plus-ng - NOT affected by this bug (source review 2026-09-23)" | |
| author = "royce@techsolvency.com via Claude" | |
| date = "2026-09-23" | |
| version = "2026-09-23.02" | |
| ifin = "https://ifin.network/t/cve-pending-pre-auth-format-string-bug-in-tac-plus-shrubbery-networks/859" | |
| ref = "https://github.com/MarcJHuber/event-driven-servers" | |
| usage = "identify-and-exclude: shares Cisco ancestry but rewrote the log sinks safely" | |
| strings: | |
| $h1 = "tac_plus-ng" | |
| $h2 = "Marc Huber" | |
| $h3 = "spawnd" | |
| $h4 = "mavis" // lowercase backend name in messages/paths | |
| $h5 = "MAVIS" // uppercase in banners | |
| condition: | |
| 2 of them | |
| } | |
| rule tac_plus_devkit_family | |
| { | |
| meta: | |
| description = "Cisco dev-kit / Shrubbery / Meta tac_plus TACACS+ daemon (any version, patched or not; excludes Huber)" | |
| author = "royce@techsolvency.com via Claude" | |
| date = "2026-09-23" | |
| version = "2026-09-23.02" | |
| ifin = "https://ifin.network/t/cve-pending-pre-auth-format-string-bug-in-tac-plus-shrubbery-networks/859" | |
| usage = "triage: identifies the code lineage; does NOT judge patch status" | |
| strings: | |
| // RUNTIME strings, verified present in real stripped binaries (glibc + | |
| // musl) 2026-09-23. NOTE: the "Copyright ... by Cisco" text is a SOURCE | |
| // COMMENT, not a literal - it is ABSENT from every compiled binary, so it | |
| // is NOT used here (using it was a real false-negative bug). | |
| $banner = "tac_plus version" // vers() banner; universal, survives strip | |
| $acl = "enableacl" // dev-kit config keyword; Huber lacks it | |
| $ver = /F4\.0\.4\.[0-9]/ // dev-kit version scheme; Huber uses dated | |
| // optional - present in glibc builds, stripped out of musl/OpenWrt: | |
| $sym1 = "send_authen_error" | |
| $sym2 = "get_authen_continue" | |
| // Huber's shared-ancestry rewrite - exclude it: | |
| $huber1 = "tac_plus-ng" | |
| $huber2 = "Marc Huber" | |
| $huber3 = "spawnd" | |
| $huber4 = "mavis" | |
| condition: | |
| (not any of ($huber*)) | |
| // it is the dev-kit daemon (banner) AND on the dev-kit line (acl/ver), | |
| // or, if the banner was customised away, two dev-kit markers: | |
| and ( ($banner and ($acl or $ver)) or (2 of ($acl, $ver, $sym1, $sym2)) ) | |
| } | |
| rule tac_plus_fmtstring_vuln_version | |
| { | |
| meta: | |
| description = "tac_plus pre-auth format string bug: version string in the vulnerable range (<= F4.0.4.31)" | |
| author = "royce@techsolvency.com via Claude" | |
| date = "2026-09-23" | |
| version = "2026-09-23.02" | |
| ifin = "https://ifin.network/t/cve-pending-pre-auth-format-string-bug-in-tac-plus-shrubbery-networks/859" | |
| cve = "pending (elttam advisory 2026-09-23)" | |
| fixed_in = "Shrubbery F4.0.4.32" | |
| caveat = "version-string based; see LIMITATIONS in file header (strip -> FN, backport -> FP)" | |
| strings: | |
| /* | |
| * F4.0.4.<NN> where NN is 0..31. Alternation: 0-9 | 10-29 | 30-31. | |
| * Trailing [^0-9] enforces a number boundary so ".31" does not also | |
| * match ".310"; the source constant is NUL-terminated, so a boundary | |
| * byte always exists. .32 and later fail all three branches by design. | |
| */ | |
| $ver_vuln = /F4\.0\.4\.([0-9]|[12][0-9]|3[01])[^0-9]/ | |
| // corroborating RUNTIME anchors (verified in real stripped binaries) so a | |
| // stray version-shaped string cannot trip this alone. Copyright/tac_plus.conf | |
| // are NOT used: absent from compiled binaries (comment / built path). | |
| $fam1 = "tac_plus version" | |
| $fam2 = "enableacl" | |
| // exclude Huber (also guards against a bundled Shrubbery config sample): | |
| $huber1 = "tac_plus-ng" | |
| $huber2 = "Marc Huber" | |
| $huber3 = "spawnd" | |
| condition: | |
| $ver_vuln and (1 of ($fam*)) and (not any of ($huber*)) | |
| } | |
| rule tac_plus_fmtstring_vuln_elf | |
| { | |
| meta: | |
| description = "As tac_plus_fmtstring_vuln_version, gated to ELF binaries to cut source-tree false positives" | |
| author = "royce@techsolvency.com via Claude" | |
| date = "2026-09-23" | |
| version = "2026-09-23.02" | |
| ifin = "https://ifin.network/t/cve-pending-pre-auth-format-string-bug-in-tac-plus-shrubbery-networks/859" | |
| cve = "pending (elttam advisory 2026-09-23)" | |
| fixed_in = "Shrubbery F4.0.4.32" | |
| caveat = "ELF only; for non-ELF firmware use tac_plus_fmtstring_vuln_version and exclude text/source in the wrapper" | |
| strings: | |
| $ver_vuln = /F4\.0\.4\.([0-9]|[12][0-9]|3[01])[^0-9]/ | |
| $fam1 = "tac_plus version" | |
| $fam2 = "enableacl" | |
| $huber1 = "tac_plus-ng" | |
| $huber2 = "Marc Huber" | |
| $huber3 = "spawnd" | |
| condition: | |
| // 0x7f 'E' 'L' 'F' little-endian at offset 0: | |
| uint32(0) == 0x464c457f and $ver_vuln and (1 of ($fam*)) and (not any of ($huber*)) | |
| } | |
| /* | |
| * Note on the pre-F4.0.4 series (2.x / 3.x / F4.0.3.x): the code lineage is the | |
| * same and older releases predate the fix, so treat any tac_plus_devkit_family | |
| * hit whose version does NOT parse as F4.0.4.32+ as vulnerable pending triage. | |
| * A precise range regex for those older, rarer strings is deliberately omitted | |
| * to avoid false positives; the family rule already flags them for a human. | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment