Improper Control of Filename for Include/Require Statement in PHP Program ('PHP File Inclusion') Status: Draft Compound Element ID: 98 (Compound Element Base: Composite)Summary The PHP application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in "require," "include," or similar functions. Extended Description In certain versions and configurations of PHP, this can allow an attacker to specify a URL to a remote location from which the software will obtain the code to execute. In other cases in association with path traversal, the attacker can specify a local file that may contain executable statements that can be parsed by PHP.
Assume all input is malicious. Use an appropriate combination of black lists and white lists to ensure only valid and expected input is processed by the system.
This is frequently a functional consequence of other weaknesses. It is usually multi-factor with other factors (e.g. MAID), although not all inclusion bugs involve assumed-immutable data. Direct request weaknesses frequently play a role. Can overlap directory traversal in local inclusion problems. Under-researched and under-reported. Other interpreted languages with "require" and "include" functionality could also product vulnerable applications, but as of 2007, PHP has been the focus. Any web-accessible language that uses executable file extensions is likely to have this type of issue, such as ASP, since .asp extensions are typically executable. Languages such as Perl are less likely to exhibit these problems because the .pl extension isn't always configured to be executable by the web server.
Shaun Clowes. "A Study in Scarlet". <http:/ Submissions PLOVER. (Externally Mined) Modifications Eric Dalci. Cigital. 2008-07-01. (External) updated Time_of_Introduction CWE Content Team. MITRE. 2008-09-08. (Internal) updated Relationships, Relationship_Notes, Research_Gaps,
Taxonomy_Mappings CWE Content Team. MITRE. 2009-01-12. (Internal) updated Relationships CWE Content Team. MITRE. 2009-03-10. (Internal) updated Relationships CWE Content Team. MITRE. 2009-05-27. (Internal) updated Description, Name Previous Entry Names PHP File
Inclusion (changed
2008-04-11) Insufficient Control of
Filename for Include/Require Statement in PHP Program (aka 'PHP
File Inclusion') (changed
2009-05-27) |
|
Page Last Updated:
May 26, 2009
|
|
CWE is a Software Assurance strategic initiative sponsored by the National Cyber Security Division of the U.S. Department of Homeland Security. This Web site is hosted by The MITRE Corporation. Contact cwe@mitre.org for more information. |
|||
