In this article
A regex change in unreleased Fail2Ban code can freeze a jail
Unreleased Fail2Ban master code contains a regular expression that can hang on attacker-influenced PAM ruser text, which stalls the pam-generic jail. A hung filter stops that jail from processing more log lines, so it stops banning and burns CPU. The advisory rates it medium, with a CVSS 3.1 base score of 5.9, and classes it as a regular-expression denial of service (CWE-1333).
How the pam-generic pattern backtracks
Commit 789571aa changed the user part of the pam-generic failregex into a repeated group of non-space runs and space runs. According to the advisory, that group can match the same input in many ways, so the regex engine tries a huge number of combinations on failure. Before that commit, the pattern was a non-space run or a lazy any-character match, which does not have the problem.
How an attacker reaches it
The attacker must be able to control the PAM ruser value that a service logs, for example a service that passes a client-supplied remote user name to PAM. Plain sshd logins do not trigger it, because sshd logs an empty ruser. The CVSS vector reads network, high attack complexity, no privileges, no user interaction, with availability as the only impact. In the author's tests on Python 3.14, about 25 extra filler characters made one log line take over 10 seconds, and 30 made fail2ban-regex hang for over 15 seconds.
Only unreleased master since 789571aa is affected
Only unreleased master since commit 789571aa is affected, and the advisory says no released version is. Release 1.1.1 returns immediately on the same inputs and still extracts the injected address. The advisory's package metadata lists 1.1.2.dev1 as the vulnerable version, so a build of that development version is the one to check. The advisory does not say whether the flaw has been exploited in the wild.
Run 1.1.1 or pick up the patched revision
If you run a build from master, move to a revision that includes the fix; the advisory's package metadata names commit 5ad738b803701e2aeaf6b5b004cb8783cc359641 as patched. No released version containing the fix is named, and the advisory gives no workaround for affected master builds. The advisory reports the commit as shipping in neither a release nor, in its view, the next one. Released 1.1.1 users need no action.
The proposed replacement pattern runs in linear time
The advisory author proposes matching one non-space character or one space per iteration, so each input can be matched only one way. With that pattern, a 30-space payload takes 0.085s in fail2ban-regex and a 5000-space payload takes 0.32s, and all 100 filter sample tests pass, including the new pam-generic injection samples. Possessive quantifiers or atomic groups would also work but need Python 3.11 or later.
What the advisory does not give
The advisory gives no CVE identifier and no public disclosure date.
| Product | Affected | Fixed |
|---|---|---|
| Fail2Ban (master) | Unreleased master since commit 789571aa (metadata lists 1.1.2.dev1) | Commit 5ad738b803701e2aeaf6b5b004cb8783cc359641 (no released version named) |
Sources
This story was produced with AI assistance from the sources listed above and fact-checked against them before publication. Read our editorial methodology and the corrections log. Spotted an error? Email [email protected].





Discussion