SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
File Upload Vulnerabilities

Exploitation and
Mitigation

Chinedu Onwukike
- Cyber Risk Consultant
The need for File Upload


Indispensable way of file sharing
 Dropbox, 4shared.com etc

Added functionality
 Increases business efficiency, enhances interaction between
end users and corporate employees

Social Networking
 Facebook, Twitter, MySpace, Instagram et al

2
The Threat


Opens another door for attackers

Lack of expertise in securing upload forms

3
Cases of File Upload Security
Case 1: Simple File upload form with no validation
Exploit: Simply upload shell (without any modification) in
server language format (asp, jsp, php, py)
Case 2: Mime Type Validation
Idea: This checks the content type. $_FILES[‘uploaded’][‘type’]
Exploit: Use of web proxies such as Burpsuite to intercept
and alter content type.


Case 3: Black listing extension types

Not good for hosted environment (running several scripting
languages)
Exploit: Impossible to predict all possible random
extensions (shell.php.345)
4
Cases of File Upload Security
Case 4: Check the image header

Idea: Using getimagesize() to determine if it is an
actual image
Exploit: Bypassed with Image editing tools
Case 5: Protection with .htaccess
Idea: To restrict the execution of script files in this
folder
Exploit: Use of web proxies such as Burpsuite to
intercept
and alter content type.
Case 6: Client Side validation
Idea: Better performance and client side checks
Exploit: Can be easily bypassed with web application
proxies
5
Tools
 BurpSuite
 Apache Server running PHP in Linux
OS.
 Any Web browser
 Fairly secure server side PHP upload
script.

6
Mitigation
•

.htaccess file should not be in the same
directory as uploaded files. Can be in parent.

•

Upload files in a directory outside the server
root

•

Avoid absolute reliance on client-side
validation

•

Create a copy of the file with random name
and add corresponding extension

7
Demonstration - PoC

8
Questions

More Related Content

PDF
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
PPTX
A5: Security Misconfiguration
PPTX
Directory Traversal & File Inclusion Attacks
PPTX
Web application vulnerability assessment
PPTX
Vulnerabilities in modern web applications
PDF
Web Application Security and Awareness
PPTX
security misconfigurations
PDF
Introduction to Web Application Penetration Testing
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
A5: Security Misconfiguration
Directory Traversal & File Inclusion Attacks
Web application vulnerability assessment
Vulnerabilities in modern web applications
Web Application Security and Awareness
security misconfigurations
Introduction to Web Application Penetration Testing

What's hot (20)

PPTX
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
PPTX
A2 - broken authentication and session management(OWASP thailand chapter Apri...
PDF
Unrestricted file upload
PDF
Local File Inclusion to Remote Code Execution
PPT
PPTX
Introduction to path traversal attack
PPT
Introduction to Web Application Penetration Testing
PDF
Ch 10: Hacking Web Servers
PDF
Privilege escalation from 1 to 0 Workshop
PDF
Web Application Penetration Testing
PPTX
Web Application Vulnerabilities
PPTX
Deep understanding on Cross-Site Scripting and SQL Injection
PPTX
Cyber security fundamentals
PDF
Network Security Fundamentals
PPTX
Secure coding practices
PDF
Insecure direct object reference (null delhi meet)
PPTX
Password Cracking
PDF
OWASP Top 10 - 2017
PDF
Overview of the Cyber Kill Chain [TM]
PDF
Web Application Security 101
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
A2 - broken authentication and session management(OWASP thailand chapter Apri...
Unrestricted file upload
Local File Inclusion to Remote Code Execution
Introduction to path traversal attack
Introduction to Web Application Penetration Testing
Ch 10: Hacking Web Servers
Privilege escalation from 1 to 0 Workshop
Web Application Penetration Testing
Web Application Vulnerabilities
Deep understanding on Cross-Site Scripting and SQL Injection
Cyber security fundamentals
Network Security Fundamentals
Secure coding practices
Insecure direct object reference (null delhi meet)
Password Cracking
OWASP Top 10 - 2017
Overview of the Cyber Kill Chain [TM]
Web Application Security 101
Ad

Viewers also liked (20)

PPT
Bypass file upload restrictions
PDF
Sql injection bypassing hand book blackrose
PPTX
Cross Domain Hijacking - File Upload Vulnerability
PPTX
Waf bypassing Techniques
PDF
XML Attack Surface - Pierre Ernst (OWASP Ottawa)
PPTX
XML & XPath Injections
PPT
{{more}} Kibana4
PPTX
Jon Gorenflo - Burp Collaborator
PDF
Apache安装配置mod security
PPTX
Web-App Remote Code Execution Via Scripting Engines
PPTX
PPTX
Apache Multiview Vulnerability
PDF
Automated and Effective Testing of Web Services for XML Injection Attacks
PDF
The Hidden XSS - Attacking the Desktop & Mobile Platforms
PPT
Methods to Bypass a Web Application Firewall Eng
PPTX
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
PDF
Building Advanced XSS Vectors
PDF
주로사용되는 Xss필터와 이를 공격하는 방법
PDF
New Methods in Automated XSS Detection & Dynamic Exploit Creation
PDF
Web Application Firewalls Detection, Bypassing And Exploitation
Bypass file upload restrictions
Sql injection bypassing hand book blackrose
Cross Domain Hijacking - File Upload Vulnerability
Waf bypassing Techniques
XML Attack Surface - Pierre Ernst (OWASP Ottawa)
XML & XPath Injections
{{more}} Kibana4
Jon Gorenflo - Burp Collaborator
Apache安装配置mod security
Web-App Remote Code Execution Via Scripting Engines
Apache Multiview Vulnerability
Automated and Effective Testing of Web Services for XML Injection Attacks
The Hidden XSS - Attacking the Desktop & Mobile Platforms
Methods to Bypass a Web Application Firewall Eng
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
Building Advanced XSS Vectors
주로사용되는 Xss필터와 이를 공격하는 방법
New Methods in Automated XSS Detection & Dynamic Exploit Creation
Web Application Firewalls Detection, Bypassing And Exploitation
Ad

Similar to File upload vulnerabilities & mitigation (20)

PPTX
File uploads
PPTX
Slides of ARPCON (File upload vulnerability by Raju Kumar)
PDF
Php File Upload
PPTX
Secure Code Warrior - Unrestricted file upload
PDF
Session9-File Upload Security
PDF
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
ODP
How secure is your code?
PDF
File upload considerations
PDF
Remote file path traversal attacks for fun and profit
PDF
Automation of web attacks from advisories to create real world exploits
PDF
Web hackingtools 2015
PDF
Web hackingtools 2015
PPTX
Secure programming with php
PDF
Web hackingtools cf-summit2014
PDF
Cyber Securitygttt buj bi j Mini Project.pdf
PDF
Art of Web Backdoor - Pichaya Morimoto
PPTX
lecture 11.pptx
PDF
Web Security: What's wrong, and how the bad guys can break your website
PPTX
VAPT PRESENTATION full.pptx
PDF
Getting Inside Common Web Security Threats
File uploads
Slides of ARPCON (File upload vulnerability by Raju Kumar)
Php File Upload
Secure Code Warrior - Unrestricted file upload
Session9-File Upload Security
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
How secure is your code?
File upload considerations
Remote file path traversal attacks for fun and profit
Automation of web attacks from advisories to create real world exploits
Web hackingtools 2015
Web hackingtools 2015
Secure programming with php
Web hackingtools cf-summit2014
Cyber Securitygttt buj bi j Mini Project.pdf
Art of Web Backdoor - Pichaya Morimoto
lecture 11.pptx
Web Security: What's wrong, and how the bad guys can break your website
VAPT PRESENTATION full.pptx
Getting Inside Common Web Security Threats

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Electronic commerce courselecture one. Pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation theory and applications.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf
sap open course for s4hana steps from ECC to s4
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
The Rise and Fall of 3GPP – Time for a Sabbatical?
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation theory and applications.pdf
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

File upload vulnerabilities & mitigation

  • 1. File Upload Vulnerabilities Exploitation and Mitigation Chinedu Onwukike - Cyber Risk Consultant
  • 2. The need for File Upload  Indispensable way of file sharing  Dropbox, 4shared.com etc Added functionality  Increases business efficiency, enhances interaction between end users and corporate employees Social Networking  Facebook, Twitter, MySpace, Instagram et al 2
  • 3. The Threat  Opens another door for attackers Lack of expertise in securing upload forms 3
  • 4. Cases of File Upload Security Case 1: Simple File upload form with no validation Exploit: Simply upload shell (without any modification) in server language format (asp, jsp, php, py) Case 2: Mime Type Validation Idea: This checks the content type. $_FILES[‘uploaded’][‘type’] Exploit: Use of web proxies such as Burpsuite to intercept and alter content type.  Case 3: Black listing extension types Not good for hosted environment (running several scripting languages) Exploit: Impossible to predict all possible random extensions (shell.php.345) 4
  • 5. Cases of File Upload Security Case 4: Check the image header Idea: Using getimagesize() to determine if it is an actual image Exploit: Bypassed with Image editing tools Case 5: Protection with .htaccess Idea: To restrict the execution of script files in this folder Exploit: Use of web proxies such as Burpsuite to intercept and alter content type. Case 6: Client Side validation Idea: Better performance and client side checks Exploit: Can be easily bypassed with web application proxies 5
  • 6. Tools  BurpSuite  Apache Server running PHP in Linux OS.  Any Web browser  Fairly secure server side PHP upload script. 6
  • 7. Mitigation • .htaccess file should not be in the same directory as uploaded files. Can be in parent. • Upload files in a directory outside the server root • Avoid absolute reliance on client-side validation • Create a copy of the file with random name and add corresponding extension 7