CVE-2026-47677: 
PHP vulnerability analysis and mitigation

Overview

CVE-2026-47677 is a critical authentication bypass vulnerability in FacturaScripts, an open-source ERP/accounting application, that allows unauthenticated attackers to take over any account with two-factor authentication (2FA) enabled. The flaw exists in Core/Controller/Login.php::twoFactorValidationAction(), which accepts a POST request containing only a username (fsNick) and a TOTP code (fsTwoFactorCode) — without verifying a password, CSRF token, or rate-limiting requests. It affects all versions up to and including 2026.2, and was disclosed and patched on July 13, 2026. The CVSS v4.0 base score is 9.3 (Critical) (GitHub Advisory, FacturaScripts Advisory).

Technical details

The root cause is improper authentication (CWE-287): the twoFactorValidationAction() handler in Core/Controller/Login.php (lines 317–328, commit 7392b489b) issues a full authenticated session cookie (fsNick + fsLogkey) upon a successful TOTP match without requiring the user to have first completed the password step (loginAction). Three compounding weaknesses amplify the severity: (1) no CSRF token validation (validateFormToken() is absent, unlike every other handler in the same file); (2) no rate-limit pre-check (userHasManyIncidents() is never called before processing); and (3) TwoFactorManager::VERIFICATION_WINDOW = 8 (17× the google2fa default of 1), meaning approximately 17 distinct six-digit codes are simultaneously valid for ~4 minutes each. The expected brute-force cost is only ~40,800 attempts for a 50% success probability, achievable from a single IP at ~400 requests/second on a default LAMP stack — typically under 3 minutes (GitHub Advisory).

Impact

Successful exploitation grants an unauthenticated attacker complete account takeover of any 2FA-enabled FacturaScripts user, including administrators. Confidentiality impact is high: the attacker gains full read access to invoices, customer and supplier data, accounting ledgers, attached files, user PII, API keys, and plugin configuration. Integrity impact is also high: the attacker can create, modify, or delete records, change permissions, issue new API keys, and — if the compromised account is an admin — upload plugins or install arbitrary code. As a secondary availability impact, generating just six failed 2FA attempts (achievable in under one second of brute-force noise) triggers a 10-minute account lockout for the legitimate user, which can be repeated indefinitely as a targeted DoS (GitHub Advisory, FacturaScripts Advisory).

Exploitability

A fully functional, ready-to-run Python proof-of-concept (poc_2fa_brute.py) is publicly included in the official security advisory, confirming the exploit maturity is rated "Attacked" (A) in the CVSS v4.0 threat metrics. The PoC requires only the target's username (nick), which is typically public information for admin accounts. In testing, the PoC achieved account takeover in as little as 24.6 seconds (11,569 attempts) from a single source IP with no proxy rotation. No threat actor attribution or CISA KEV catalog listing has been reported at this time, and no EPSS score is currently available as the CVE ID is still in "Reserved" status (GitHub Advisory, FacturaScripts Advisory).

Exploitation steps

  1. Reconnaissance: Identify internet-facing FacturaScripts instances (versions ≤ 2026.2) using search engines or tools like Shodan. Determine the target user's nick — for admin accounts, common values include admin, the company name, or initials, which are often publicly visible.
  2. Confirm 2FA is enabled: Attempt a normal login with the target nick and an incorrect password. If the application presents a 2FA prompt or the login flow references two-factor authentication, the account is a valid target.
  3. Launch brute-force against the 2FA endpoint: Send unauthenticated HTTP POST requests to /login?action=two-factor-validation (or equivalently with action in the POST body) with the fields fsNick=<target_nick> and fsTwoFactorCode=<random_6_digit_code>. Use the published PoC script with 32 threads to sustain ~400 RPS:
    BASE=http://target NICK=admin THREADS=32 python poc_2fa_brute.py
  4. Detect successful authentication: Monitor HTTP responses — a 302 redirect with a Set-Cookie header containing fsLogkey indicates a valid TOTP code was found and a session has been issued.
  5. Hijack the session: Use the returned fsNick and fsLogkey cookies to authenticate as the victim user:
    curl --cookie 'fsNick=admin; fsLogkey=<value>' http://target/ListUser
  6. Post-exploitation: With admin access, enumerate data (invoices, customer records, API keys), modify records, change permissions, or upload a malicious plugin to achieve persistent code execution on the server (GitHub Advisory, FacturaScripts Advisory).

Indicators of compromise

  • Network: High volume of HTTP POST requests to /login with action=two-factor-validation from a single or small set of source IPs; request rates exceeding normal user behavior (hundreds per second); requests containing only fsNick and fsTwoFactorCode fields with no CSRF token or session cookie.
  • Logs: Web server access logs showing thousands of POST requests to the login endpoint within a short time window; FacturaScripts application logs (two-factor-code-invalid warnings) accumulating rapidly for a specific username; sudden appearance of two-factor-no-pending-login log entries (if partially patched).
  • Session/Authentication: Unexpected fsLogkey session cookies issued for privileged accounts (e.g., admin) without a corresponding prior loginAction password-step entry in logs; new sessions originating from unusual geographic locations or IP addresses for known admin accounts.
  • Application Behavior: Legitimate users experiencing repeated 10-minute lockouts from loginAction (indicating the incident counter was triggered by brute-force noise); unexpected changes to user permissions, API keys, or newly uploaded plugins following a suspicious login event (GitHub Advisory).

Mitigation and workarounds

Upgrade to FacturaScripts version 2026.3, which addresses this vulnerability along with several other security fixes including path traversal in file uploads, open-redirect protection, and improved cookie security (FacturaScripts Release). No official configuration-only workaround is available; the advisory states that four independent code-level fixes are required and any single fix alone is insufficient. As an interim measure until patching is possible, administrators should consider placing the FacturaScripts login endpoint behind a WAF or reverse proxy with aggressive rate-limiting on /login, and disabling 2FA for accounts if the application cannot be immediately updated — paradoxically, 2FA-enabled accounts are more vulnerable than non-2FA accounts on unpatched versions (GitHub Advisory, FacturaScripts Advisory).

Community reactions

The vulnerability was reported by researcher janssensjelle and published by NeoRazorX (the FacturaScripts maintainer) on July 13, 2026, with a patch released the same day. The advisory notes that enabling 2FA on an account in unpatched versions is "strictly weaker than not enabling it," a notable finding that inverts the expected security benefit of MFA. No broader media coverage or significant social media discussion has been identified beyond the GitHub advisory and associated database entries at this time (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-45262CRITICAL9.9
  • PHP logoPHP
  • facturascripts/facturascripts
NoYesDec 04, 2026
CVE-2026-47677CRITICAL9.3
  • PHP logoPHP
  • facturascripts/facturascripts
NoYesDec 04, 2026
CVE-2026-45263HIGH8
  • PHP logoPHP
  • facturascripts/facturascripts
NoYesDec 04, 2026
CVE-2026-45693HIGH7.5
  • PHP logoPHP
  • facturascripts/facturascripts
NoNoDec 04, 2026
GHSA-j3w3-jvjp-wgcfMEDIUM4.8
  • PHP logoPHP
  • laminas/laminas-diactoros
NoNoDec 04, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management