Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2024-4367 PoC — Mozilla Firefox 安全漏洞

Source
Associated Vulnerability
Title: Mozilla Firefox 安全漏洞 (CVE-2024-4367)
Description:A type check was missing when handling fonts in PDF.js, which would allow arbitrary JavaScript execution in the PDF.js context. This vulnerability affects Firefox < 126, Firefox ESR < 115.11, and Thunderbird < 115.11.
Readme
> [!IMPORTANT]
> 本リポジトリは、脆弱性を学習するためのものです。     
> 本ハンズオンは、必ず自分の管理する適切なコンピュータで行ってください。違法行為は絶対に行わないでください。     
> また本リポジトリによって発生した、一切の損害・責任を、作者は負いません。     

# CVE-2024-4367-hands-on
CVE-2024-4367を体験するハンズオン

## poc.pdfの作成
```bash
python CVE-2024-4367-PoC/CVE-2024-4367.py "alert('document.domain')"
```
引用元:https://github.com/LOURC0D3/CVE-2024-4367-PoC

攻撃用のpoc.pdfが作成されます。    
詳しい使い方は、下記を参考にしてください。    
https://github.com/LOURC0D3/CVE-2024-4367-PoC


## 脆弱性のあるFirefoxを起動し、攻撃を確認
```bash
python firefox.py 125
```
攻撃可能なバージョンのFirefox Nightlyを使用して、poc.pdfを開きます。   
初回起動時には、Firefox Nightlyのダウンロードを行うため、時間がかかります。   
JavaScriptが実行され、アラートが表示されたことを確認します。   

## 脆弱性修正済みのFirefoxで検証
```bash
python firefox.py 135
```
新しいバージョンのFirefox Nightlyでpoc.pdfを開き、アラートが表示されず、脆弱性が修正されていることを確認します。

## PDF.jsのソースコードの比較
脆弱性が含まれている[vulnerable-pdf.js](vulnerable-pdf.js)と脆弱性が修正された[invulnerable-pdf.js](invulnerable-pdf.js)があります。

[pdfjs_diff_font_renderer.js](pdfjs_diff_font_renderer.js)は、[vulnerable-pdf.js/src/core/font_renderer.js](vulnerable-pdf.js/src/core/font_renderer.js)と[invulnerable-pdf.js/src/core/font_renderer.js](invulnerable-pdf.js/src/core/font_renderer.js)のdiff差分です。

File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →