Course Projects
Juice Shop: Cross-Site Scripting (Video XSS)

Date: 9/6
Prepared By: [Name removed from the site]
1. Security Engagement Summary
Overview
This report covers the "Video XSS" challenge in the Juice Shop application. The challenge focused on exploiting a path traversal vulnerability to inject a Cross-Site Scripting (XSS) payload through a promo video’s subtitle file, demonstrating how weak file upload handling can lead to critical security vulnerabilities.
Scope
The assessment targeted the promo video feature of the application, with the goal of injecting a malicious XSS payload into the subtitle file used in the video.
Methodology
- Tools Used:
- Web Browser: Used to navigate and inspect the promo video feature.
- Developer Tools: Utilized for analyzing HTML and JavaScript code.
- Burp Suite: For intercepting and analyzing HTTP requests.
- Command Line Tools: Used to create a zip file with the necessary structure to exploit the vulnerability.
- Twitter Search: To locate the promo video URL through related social media posts.
Key Findings
- A path traversal vulnerability allowed overwriting the subtitle file of the promo video. Injecting an XSS payload into the subtitle file caused the payload to execute whenever the video was played.
Recommendations
- Ensure proper input validation and file upload handling to prevent path traversal attacks.
- Sanitize and validate file paths to prevent unauthorized access or modification of internal resources.
2. Significant Vulnerabilities Summary
Vulnerability List
- Path Traversal and XSS Injection
- Risk Rating: High
- Impact: Allows an attacker to inject malicious scripts into a video file’s subtitle, which could lead to script execution on user devices and potentially compromise the security of the web application.
Impact
- The successful exploitation of this vulnerability can lead to arbitrary script execution in the victim's browser. This could be used for various attacks, such as session hijacking, data theft, or further exploitation of the affected system.
3. Significant Vulnerabilities Detail
3.1 Vulnerability: Path Traversal and XSS Injection
- Description: A path traversal vulnerability in the file upload feature allowed an attacker to navigate through directories and overwrite critical files, such as the subtitle file used in the promo video. By injecting an XSS payload into this file, the payload was executed when the video was played, leading to an XSS attack.
- Proof of Concept: The vulnerability was exploited by crafting a zip file with a directory structure that navigated to the target subtitle file. After uploading this file through the complaint form, the subtitle file was overwritten, and the injected XSS payload was executed when the video was played.
Steps:
- Locate Promo Video URL:
- Located the promo video URL using targeted Twitter searches:
https://twitter.com/bkimminich/status/1114621693299916800https://twitter.com/owasp_juiceshop/status/1350381894010077184
- The video URL was also accessible at
http://localhost:3000/promotion.
- Located the promo video URL using targeted Twitter searches:


- Identify the Subtitle File:
- Analyzed the promo video page using Developer Tools and found that the video used a WebVTT subtitle file located at
http://localhost:3000/assets/public/videos/owasp_promo.vtt.
- Analyzed the promo video page using Developer Tools and found that the video used a WebVTT subtitle file located at

- Create Exploit Zip File:
- Prepared a zip file with the structure
frontend/dist/frontend/assets/public/videos/owasp_promo.vtt. - Injected the XSS payload:
</script><script>alert('xss')</script>. - Created the zip file using the command:
zip exploit.zip ../../frontend/dist/frontend/assets/public/videos/owasp_promo.vtt.
- Prepared a zip file with the structure

- Upload and Execute:
- Uploaded the crafted zip file through the complaint form.
- Verified the XSS payload execution by visiting the promo video page.


- Remediation Strategy:
- Input Validation: Implement proper input validation to ensure that file paths and uploads cannot be manipulated to traverse directories.
- File Upload Security: Strengthen the file upload process by sanitizing file paths, using safe directory names, and restricting file access to allowed directories.
- Use Absolute Paths: Modify the application to use absolute paths for internal resources, avoiding the risks associated with relative paths.
- Business Impact: Exploiting this vulnerability allows attackers to execute arbitrary scripts within the browser, potentially leading to a full compromise of user sessions or further security breaches. It could also damage the application's reputation and expose sensitive data.
4. Security Analysis Methodology
Tools and Techniques
- Web Browser: Used to navigate the application and inspect the promo video feature.
- Developer Tools: Applied to analyze the video page and identify the subtitle file.
- Burp Suite: Used to intercept HTTP requests and analyze the server’s response.
- Command Line Tools: Used to create a zip file with a malicious payload to overwrite the subtitle file.
Methodology
- Locate Promo Video: Used targeted Twitter searches to locate the URL of the promo video, which was not listed in the application’s sitemap.
- Identify Subtitle File: Using Developer Tools, identified that the video used a WebVTT subtitle file. Determined the file's location by inspecting the video source and response headers.
- Exploit Path Traversal: Crafted a zip file containing the payload and structured the directory to exploit a path traversal vulnerability, allowing overwriting of the subtitle file.
- Upload Exploit: Uploaded the zip file through the complaint form, overwriting the subtitle file, and injecting the XSS payload.
Evidence
- Screenshots of the promo video URL, subtitle file location, directory structure, and XSS execution are provided to support the findings.
Limitations
- The assessment was limited to the promo video feature and the file upload vulnerability. Further testing may be required to determine whether other features are susceptible to similar exploits.
Additional Sections
Executive Summary
The "Video XSS" challenge exploited a path traversal vulnerability in the Juice Shop application, allowing an attacker to inject an XSS payload into a video subtitle file. The vulnerability was exploited by crafting a zip file with a malicious payload and uploading it through the complaint form, leading to arbitrary script execution when the video was played.
Appendix
- Screenshots of the promo video, subtitle file, directory structure, and XSS execution are included for reference.
ملفات PDF
الملفات في مستودعي العام على GitHub (تُفتح هناك).
- DEPI-FinalProject.pdf PDF · 0.35 MB
- Depercated Interface.pdf PDF · 0.23 MB
- XSI.pdf PDF · 1.04 MB
- PoC.pdf PDF · 0.43 MB
- Insecure Deserialization.pdf PDF · 0.82 MB
- Unvalidated redirects.pdf PDF · 0.65 MB
- Vulnerable Components.pdf PDF · 2.93 MB
الملف في مستودعي: Graduation Project/PoC/0-Cross-Site Scripting (XSS) Vulnerability/Juice Shop Vulnerability Assessment Report.md
