psf-idunno-anticsrf-check(8)
Overview
Idunno.AntiCsrf deserialization on GNU/Linux (Mono ASP.NET): check, hunt, mitigation (v1) CVE-2026-131914
Idunno.AntiCsrf (Idunno.AntiCsrf.dll 0.9.1.0, "0.9.1 Beta", last released December 2008, no maintainer, no fix) is an ASP.NET WebForms anti-CSRF module. On every POST to a page it passes the CSRF form field to an unkeyed ObjectStateFormatter, with no MAC and no type restriction, before the page runs: one anonymous request with any CSRF cookie and a .NET gadget chain in the form field runs code in the web server. Mandiant (MNDT-2026-0048) has seen it exploited on Windows and IIS.
This is the GNU/Linux tool. It covers ASP.NET WebForms under Mono (mod_mono in Apache, XSP, fastcgi-mono-server behind nginx), whose System.Web has the same unkeyed ObjectStateFormatter, and any folder you point it at: a share, a backup or a deployment tree for Windows servers. On Windows and IIS use idunno-anticsrf-check.ps1 from this folder.
Command reference
The original help text below includes the command syntax, options, environment variables and exit codes supplied with this tool. Review the source and test any change before applying it to a production system.
Original command-line help
Idunno.AntiCsrf deserialization on GNU/Linux (Mono ASP.NET): check, hunt, mitigation (v1)
CVE-2026-131914
If this software is helpful, consider a donation to our 501c3 nonprofit:
https://privacysafe.foundation
Help and documentation: https://privacysafe.app/docs/security-patches/web-apps/aspnet/
Idunno.AntiCsrf (Idunno.AntiCsrf.dll 0.9.1.0, "0.9.1 Beta", last released December
2008, no maintainer, no fix) is an ASP.NET WebForms anti-CSRF module. On every POST
to a page it passes the CSRF form field to an unkeyed ObjectStateFormatter, with no
MAC and no type restriction, before the page runs: one anonymous request with any
CSRF cookie and a .NET gadget chain in the form field runs code in the web server.
Mandiant (MNDT-2026-0048) has seen it exploited on Windows and IIS.
This is the GNU/Linux tool. It covers ASP.NET WebForms under Mono (mod_mono in Apache,
XSP, fastcgi-mono-server behind nginx), whose System.Web has the same unkeyed
ObjectStateFormatter, and any folder you point it at: a share, a backup or a deployment
tree for Windows servers. On Windows and IIS use idunno-anticsrf-check.ps1 from this
folder.
Usage:
./idunno-anticsrf-check.sh [command] [options]
check (default) Read-only. Finds the Mono web applications: mod_mono
MonoApplications and .webapp files, nginx server blocks
that send .aspx to FastCGI, and running XSP and
fastcgi-mono-server processes (read from their own
--applications, --root, --appconfigfile and --appconfigdir
arguments). Searches them and ROOTS for Idunno.AntiCsrf.dll
(by name, by Mandiant's three SHA-256 hashes, and by the
module's code inside any DLL in a bin folder), every
web.config that registers the module or still names it,
Mono's machine-wide web.config, the Mono GAC and ASP.NET
shadow copies. Also looks in running docker and podman
containers. A web.config that is a symbolic link is
reported, never read. Exit 0 = not found, 1 = found,
2 = something could not be read or there was nothing to
search.
hunt Read-only. Reads the web server and Mono logs of the last
HUNT_DAYS days: the module's PotentialCsrfException and
deserialization errors, which every attempt leaves when
errors are logged, and POST requests to .aspx pages
answered with 500 (and, summarized, 302). Lists pages,
scripts and binaries changed in the applications in the
same period, and marks the ones that look like a web
shell. Exit 0 = nothing found, 1 = leads to look at,
2 = no log could be read.
mitigate [--dry-run] [--restart] (root) Removes every registration of
the module from every web.config that has one. Each file
is read without following links and copied first, edited
as text so the rest of the file stays byte for byte, and
checked as XML; only a result that parses and registers
nothing replaces the original, through a new file renamed
over it with the same owner and mode. A symbolic link is
left alone and reported. Needs python3. The DLL and the csrfSettings section stay,
because pages may still refer to them. Mono's System.Web
unloads an application when its web.config changes, so the
next request runs without the module. --restart also
restarts Apache when it hosts mod_mono and every running
service that runs XSP or a Mono FastCGI server.
rollback [--dry-run] [--restart] Puts back every file mitigate changed.
version Prints the script version.
Taking the module out closes the hole and removes its CSRF protection: replace
it with a supported mechanism (see the README).
Env overrides:
ROOTS="/var/www /srv /opt /home /usr/share/nginx" more folders to search
(default shown), beside the applications found
MAX_DEPTH=12 how deep each folder is searched
APACHE_CONF_DIRS="/etc/apache2 /etc/httpd" NGINX_CONF_DIRS="/etc/nginx"
WEBAPP_DIRS="/etc/xsp4 /etc/xsp2 /etc/xsp /etc/mono-server4 /etc/mono-server2 /etc/mono-server"
MONO_CONF_DIRS="/etc/mono /usr/local/etc/mono" (machine-wide web.config)
MONO_GAC_DIRS="/usr/lib/mono/gac /usr/local/lib/mono/gac"
SHADOW_DIRS="/tmp /var/tmp" where Mono keeps its ASP.NET shadow copies
EXTRA_SHA256="h1 h2" more SHA-256 hashes of the DLL, as they are published
HUNT_DAYS=60 how far back hunt reads
HUNT_LOG_FILES the access logs hunt reads, instead of the defaults
HUNT_ERROR_LOG_FILES the error logs hunt reads, instead of the defaults
STATE_DIR where mitigate keeps its copies and manifest
(default /var/lib/psf-security-patches/idunno-anticsrf)
PSF_LOCK_WAIT seconds a run that changes the host waits for another
one that is already changing it (default 30)
SCAN_CONTAINERS=1 0 skips running docker and podman containersThe Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.