CVE-2011-3336
PHP vulnerability analysis and mitigation

Overview

CVE-2011-3336 is a vulnerability in the BSD implementation of libc's regcomp function that leads to denial of service through stack exhaustion. The vulnerability was discovered in 2011 and affects various BSD-based systems including NetBSD 5.1, OpenBSD 5.0, FreeBSD 8.2, and MacOSX (NIST NVD, CX Security).

Technical details

The vulnerability exists in the regcomp() function of BSD libc implementation where recursion and poor memory management can lead to unexpected application termination. The issue specifically occurs in the regular expression compilation process where certain patterns can trigger uncontrolled recursion and memory exhaustion. The vulnerability has a CVSS base score of 7.8/10, with an impact subscore of 6.9/10 and exploitability subscore of 10/10 (CX Security).

Impact

When exploited, this vulnerability can cause denial of service through stack exhaustion or memory exhaustion. In applications using regcomp() to process untrusted input, specially crafted regular expressions can cause the application to crash or consume excessive system resources (Full Disclosure).

Exploitability

The vulnerability can be triggered using specially crafted regular expressions that cause excessive recursion or memory consumption. For example, patterns like '(.?)((((.*){1,100}){1,100}){1,100}){1,100}' can cause the system to run out of swap space. The vulnerability has been demonstrated to affect various applications including ProFTPD and web browsers (CX Security).

Mitigation and workarounds

The recommended fix includes implementing memory usage limits (suggested at 128MB for one regcomp(3) call) and recursion limits (set to 256 levels). NetBSD has implemented these fixes in their libc implementation. For systems without patches, limiting the size of input passed to the regular expression engine or avoiding quantification nesting in expressions can help mitigate the issue (CX Security).

Community reactions

There were varying responses from different vendors regarding this vulnerability. While NetBSD worked to fix the flaws, Red Hat initially decided not to address similar issues in GNU libc, stating they did not consider it a security issue for client applications using regcomp() on untrusted input. This created some debate in the security community about the responsibility for securing regex implementations (CX Security).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-77143HIGH8.8
  • PHP logoPHP
  • composer://jweiland/pforum
NoYesAug 25, 2026
CVE-2026-77142HIGH8.8
  • PHP logoPHP
  • composer://jweiland/yellowpages2
NoYesAug 25, 2026
CVE-2026-77146HIGH8.3
  • PHP logoPHP
  • composer://in2code/femanager
NoYesAug 25, 2026
CVE-2026-77145HIGH7.1
  • PHP logoPHP
  • composer://jweiland/events2
NoYesAug 25, 2026
CVE-2026-77144HIGH7.1
  • PHP logoPHP
  • composer://jweiland/events2
NoYesAug 25, 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

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