️Log Injection & sshguard Bypass in pfSense 2.8.0 — A Securit
The pfSense WebGUI login page logs the username field without stripping carriage-return and newline characters, so an unauthenticated attacker can inject fake log lines. Because sshguard parses those logs with a weak pattern, the injected lines can make it block an arbitrary IP address, causing a denial of service, and usernames containing a dot are not tracked at all, allowing brute-force attempts to go unnoticed.
Published on medium.com
In this write-up, I present a security issue identified in pfSense 2.8.0 (stable version) affecting both log integrity and brute-force protection mechanisms.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The login form passes the username to the logger without removing carriage-return and newline characters, and sshguard's username pattern does not match names containing a dot.
Impact
An unauthenticated attacker could forge log entries, make sshguard block an arbitrary IP address and cause a denial of service, and usernames containing a dot may escape brute-force tracking; the text does not show a working end-to-end exploit against a live firewall.
What the attacker needed
Network access to the WebGUI login page; a valid CSRF token from the login page; sshguard reading the pfSense logs
The fix
The login form should reject carriage-return and newline characters in the username and escape user input before it is written to the log; the report links to vendor advisories and commits but does not itself state that the issue was fixed.
How it was found
- Send a login request to the WebGUI index page with a valid CSRF token.
- Put a username containing an encoded newline followed by a fake log line in the username field.
- Observe that the log is split into several lines and the injected text looks like a real entry.
- Craft the injected line to look like an sshguard attack record naming a chosen IP address.
- Observe that sshguard blocks that IP address.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you type a wrong username into a login page, the server writes it into a log file. This report shows that the page does not clean the username first, so someone can slip in line breaks and extra fake log lines. A separate tool called sshguard reads those logs to decide which IP addresses to block, and it can be tricked into blocking an address the attacker chooses, or into ignoring repeated login attempts.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.