CWE
Home > CWE List > COMPOSITE SLICE: CWE-434: Unrestricted File Upload (1.6)  

CWE-434: Unrestricted File Upload

 
Unrestricted File Upload
Definition in a New Window Definition in a New Window
Compound Element ID: 434 (Compound Element Base: Composite)Status: Draft
+ Description

Description Summary

The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.
+ Alternate Terms
File Upload of Dangerous Type:

Formerly called "File Upload of Dangerous Type"

+ Time of Introduction
  • Implementation
+ Applicable Platforms

Languages

All

+ Observed Examples
ReferenceDescription
CVE-2001-0901Web-based mail product stores ".shtml" attachments that could contain SSI
CVE-2002-1841PHP upload does not restrict file types
CVE-2005-1868upload and execution of .php file
CVE-2005-1881upload file with dangerous extension
CVE-2005-0254program does not restrict file types
CVE-2004-2262improper type checking of uploaded files
CVE-2006-4558Double "php" extension leaves an active php extension in the generated filename.
CVE-2006-6994ASP program allows upload of .asp files by bypassing client-side checks
CVE-2005-3288ASP file upload
CVE-2006-2428ASP file upload
+ Potential Mitigations
PhaseDescription

Determine the size and type of files that users are expected to upload to your system. Take measures to assure that the files meet those requirements.

+ Other Notes

This can have a chaining relationship with incomplete blacklist / permissive whitelist errors when the product tries, but fails, to properly limit which types of files are allowed.

This can also overlap multiple interpretation errors for intermediaries, e.g. anti-virus products that do not filter attachments with certain file extensions that can be processed by client systems.

This can be primary when there is no check at all. If is frequently resultant when use of double extensions (e.g. ".php.gif") bypass sanity checks. Also resultant from client-side enforcement; some products will include web script in web clients to check the filename, without verifying on the server side.

+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
PeerOfWeakness BaseWeakness Base183Permissive Whitelist
Research Concepts1000
PeerOfWeakness BaseWeakness Base184Incomplete Blacklist
Research Concepts1000
PeerOfWeakness ClassWeakness Class216Containment Errors (Container Errors)
Research Concepts1000
RequiresWeakness BaseWeakness Base351Insufficient Type Distinction
Research Concepts1000
ChildOfCategoryCategory429Handler Errors
Development Concepts (primary)699
PeerOfWeakness BaseWeakness Base430Deployment of Wrong Handler
Research Concepts1000
RequiresWeakness BaseWeakness Base436Interpretation Conflict
Research Concepts1000
PeerOfWeakness BaseWeakness Base436Interpretation Conflict
Research Concepts1000
ChildOfCategoryCategory632Weaknesses that Affect Files or Directories
Resource-specific Weaknesses (primary)631
ChildOfWeakness ClassWeakness Class669Incorrect Resource Transfer Between Spheres
Research Concepts (primary)1000
ChildOfCategoryCategory714OWASP Top Ten 2007 Category A3 - Malicious File Execution
Weaknesses in OWASP Top Ten (2007) (primary)629
CanFollowWeakness ClassWeakness Class73External Control of File Name or Path
Research Concepts1000
CanFollowWeakness BaseWeakness Base184Incomplete Blacklist
Research Concepts1000
+ Research Gaps

PHP applications are most targeted, but this likely applies to other languages that support file upload, as well as non-web technologies. ASP applications have also demonstrated this problem.

+ Affected Resources
  • File/Directory
+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
PLOVERUnrestricted File Upload
OWASP Top Ten 2007A3CWE More SpecificMalicious File Execution
+ References
Richard Stanway (r1CH). "Dynamic File Uploads, Security and You". <http://shsc.info/FileUploadSecurity>.
+ Content History
Submissions
Submission DateSubmitterOrganizationSource
PLOVERExternally Mined
Modifications
Modification DateModifierOrganizationSource
2008-07-01Eric DalciCigitalExternal
updated Time of Introduction
2008-09-08CWE Content TeamMITREInternal
updated Alternate Terms, Relationships, Other Notes, Taxonomy Mappings
2009-01-12CWE Content TeamMITREInternal
updated Relationships
Composite Components
Composite Components
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
 
Insufficient Type Distinction
Definition in a New Window Definition in a New Window
Weakness ID: 351 (Weakness Base)Status: Draft
+ Description

Description Summary

The software does not properly distinguish between different types of elements in a way that leads to insecure behavior.
+ Time of Introduction
  • Implementation
+ Applicable Platforms

Languages

All

+ Observed Examples
ReferenceDescription
CVE-2005-2260Browser user interface does not distinguish between user-initiated and synthetic events.
CVE-2005-2801Product does not compare all required data in two separate elements, causing it to think they are the same, leading to loss of ACLs. Similar to Same Name error.
+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfWeakness ClassWeakness Class345Insufficient Verification of Data Authenticity
Development Concepts (primary)699
Research Concepts (primary)1000
PeerOfWeakness BaseWeakness Base436Interpretation Conflict
Research Concepts1000
RequiredByCompound Element: CompositeCompound Element: Composite434Unrestricted File Upload
Research Concepts1000
+ Relationship Notes

Overlaps others, e.g. Multiple Interpretation Errors.

+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
PLOVERInsufficient Type Distinction
+ Content History
Submissions
Submission DateSubmitterOrganizationSource
PLOVERExternally Mined
Modifications
Modification DateModifierOrganizationSource
2008-07-01Eric DalciCigitalExternal
updated Time of Introduction
2008-09-08CWE Content TeamMITREInternal
updated Relationships, Relationship Notes, Taxonomy Mappings
 
Interpretation Conflict
Definition in a New Window Definition in a New Window
Weakness ID: 436 (Weakness Base)Status: Incomplete
+ Description

Description Summary

Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.

Extended Description

This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.

+ Time of Introduction
  • Architecture and Design
  • Implementation
+ Applicable Platforms

Languages

All

+ Observed Examples
ReferenceDescription
CVE-2005-1215Bypass filters or poison web cache using requests with multiple Content-Length headers, a non-standard behavior.
CVE-2002-0485Anti-virus product allows bypass via Content-Type and Content-Disposition headers that are mixed case, which are still processed by some clients.
CVE-2002-1978FTP clients sending a command with "PASV" in the argument can cause firewalls to misinterpret the server's error as a valid response, allowing filter bypass.
CVE-2002-1979FTP clients sending a command with "PASV" in the argument can cause firewalls to misinterpret the server's error as a valid response, allowing filter bypass.
CVE-2002-0637Virus product bypass with spaces between MIME header fields and the ":" separator, a non-standard message that is accepted by some clients.
CVE-2002-1777AV product detection bypass using inconsistency manipulation (file extension in MIME Content-Type vs. Content-Disposition field).
CVE-2005-3310CMS system allows uploads of files with GIF/JPG extensions, but if they contain HTML, Internet Explorer renders them as HTML instead of images.
CVE-2005-4260Interpretation conflict allows XSS via invalid "<" when a ">" is expected, which is treated as ">" by many web browsers.
CVE-2005-4080Interpretation conflict (non-standard behavior) enables XSS because browser ignores invalid characters in the middle of tags.
+ Other Notes

The classic multiple interpretation flaws were reported in a paper that described the limitations of intrusion detection systems. Ptacek and Newsham (see references below) showed that OSes varied widely in their behavior with respect to unusual network traffic, which made it difficult or impossible for intrusion detection systems to properly detect certain attacker manipulations that took advantage of the OS differences. Another classic multiple interpretation error is the "poison null byte" described by Rain Forest Puppy (see reference below), in which null characters have different interpretations in Perl and C, which have security consequences when Perl invokes C functions. Similar problems have been reported in ASP (see ASP reference below) and PHP. Some of the more complex web-based attacks, such as HTTP request smuggling, also involve multiple interpretation errors.

A comment on a way to manage these problems is in David Skoll in the reference below.

Manipulations are major factors in multiple interpretation errors, such as doubling, inconsistencies between related fields, and whitespace.

+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfWeakness ClassWeakness Class435Interaction Error
Development Concepts (primary)699
Research Concepts (primary)1000
ParentOfWeakness VariantWeakness Variant86Failure to Sanitize Invalid Characters in Identifiers in Web Pages
Research Concepts1000
ParentOfWeakness BaseWeakness Base115Misinterpretation of Input
Development Concepts (primary)699
Research Concepts (primary)1000
PeerOfWeakness BaseWeakness Base351Insufficient Type Distinction
Research Concepts1000
RequiredByCompound Element: CompositeCompound Element: Composite434Unrestricted File Upload
Research Concepts1000
PeerOfCompound Element: CompositeCompound Element: Composite434Unrestricted File Upload
Research Concepts1000
ParentOfWeakness BaseWeakness Base437Incomplete Model of Endpoint Features
Development Concepts (primary)699
Research Concepts (primary)1000
ParentOfWeakness BaseWeakness Base444Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling')
Research Concepts (primary)1000
ParentOfWeakness VariantWeakness Variant626Null Byte Interaction Error (Poison Null Byte)
Development Concepts699
Research Concepts1000
ParentOfWeakness VariantWeakness Variant650Trusting HTTP Permission Methods on the Server Side
Research Concepts (primary)1000
+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
PLOVERMultiple Interpretation Error (MIE)
+ References
Steve Christey. "On Interpretation Conflict Vulnerabilities". Bugtraq. 2005-11-03.
Thomas H. Ptacek and Timothy N. Newsham. "Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection". January 1998. <http://www.insecure.org/stf/secnet_ids/secnet_ids.pdf>.
Brett Moore. "0x00 vs ASP file upload scripts". 2004-07-13. <http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf>.
Rain Forest Puppy. "Poison NULL byte". Phrack.
David F. Skoll. "Re: Corsaire Security Advisory - Multiple vendor MIME RFC2047 encoding". Bugtraq. 2004-09-15. <http://marc.theaimsgroup.com/?l=bugtraq&m=109525864717484&w=2>.
+ Content History
Submissions
Submission DateSubmitterOrganizationSource
PLOVERExternally Mined
Modifications
Modification DateModifierOrganizationSource
2008-07-01Eric DalciCigitalExternal
updated Time of Introduction
2008-09-08CWE Content TeamMITREInternal
updated Relationships, Other Notes, Taxonomy Mappings
2008-10-14CWE Content TeamMITREInternal
updated Description
2009-05-27CWE Content TeamMITREInternal
updated Related Attack Patterns
2009-10-29CWE Content TeamMITREInternal
updated Relationships
Page Last Updated: October 29, 2009