Remote File Inclusion
Description
The application allows to load and execute malicious files from remote locations. This practice may allow an attacker to retrieve sensitive data from the server or execute commands remotely.
Impact
- Obtain sensitive data from the server.
- Execute commands remotely.
Recommendation
Avoid the usage of dangerous functions such as include, exec, eval, file, readfile among others using non-sanitized data.
Threat
Authenticated attacker from the Internet.
Expected Remediation Time
⌚ 120 minutes.
Score
Default score using CVSS 3.1. It may change depending on the context of the vulnerability.
Base
- Attack vector: N
- Attack complexity: L
- Privileges required: L
- User interaction: N
- Scope: C
- Confidentiality: L
- Integrity: L
- Availability: L
Temporal
- Exploit code madurity: H
- Remediation level: U
- Report confidence: C
Result
- Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L/E:H/RL:U/RC:C
- Score:
- Base: 7.4
- Temporal: 7.4
- Severity:
- Base: High
- Temporal: High
Code Examples
Compliant code
Implement a check for every fragment introduced to the application
public partial class WebForm : System.Web.UI.Page {
protected void File_Load(object file, EventArgs e) {
verifiedFile = secureFileContents(file, args*)
runScrypt(verifiedFile);
}
}
Non compliant code
Some fragments can be inserted into the application without server side verification
public partial class WebForm : System.Web.UI.Page{
protected void File_Load(object file, EventArgs e){
runScrypt(file);
}
}
Requirements
- 173. Discard unsafe inputs
- 265. Restrict access to critical processes
- 266. Disable insecure functionalities
Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.