⚠️ 這個工具 還沒在真正的 Minecraft 客戶端上實測過 (作者沒有 Windows 環境), 目前的驗證都是在 Java 層模擬完成。請當成「先擋一下」的過渡方案,不是官方修補。
⚠️ 這個工具 還沒在真正的 Minecraft 客戶端上實測過 (作者沒有 Windows 環境), 目前的驗證都是在 Java 層模擬完成。請當成「先擋一下」的過渡方案,不是官方修補。
此工具僅為臨時解方,不是 Mojang 官方修復。
此工具可能存在誤判和漏判的可能,且不保證可以攔截所有攻擊及異常警告是正確的。
此工具不負任何誤判和漏判的直接/間接經濟損失和相應責任,所有責任由使用者自行承擔。若您不同意,請 不要安裝,直接拒絕所有伺服器的資源包發送請求!
Minecraft 允許伺服器發「資源包」給玩家,裡面可以放字型檔。有人做出了攻擊: 在字型裡藏一段惡意程式, 玩家一畫到那個字,電腦就被執行任意程式 (公開示範只是開個小算盤,但同樣可以裝後門)。
問題出在遊戲畫字用的那套繪字引擎, Minecraft 官方目前還沒修 。
字型全部走「安全通道」:所有字型載入時都關掉繪字引擎的 hinting(進階對齊)步驟。 攻擊之所以成立,是因為那一步會執行字型裡自帶的程式碼;關掉它,字型裡的程式就沒有機會跑。 這個做法不需要先認出攻擊長什麼樣 ,所以連還沒公開的變種也擋得住。
代價是畫質:少了 hinting,小字會稍微變糊。這是刻意的取捨 —— 用一點畫質換掉整類攻擊 。
實際差多少,看圖最準(上排=原版,下排=本工具):
圖是**真的用 Minecraft 26.3 內建的同一個繪字引擎(FreeType 2.14.3)**畫出來的,不是示意圖;放大成像素格方便比較
HUD 那種 9px 小字差最多 (邊緣變柔、不再對齊像素格);16px 還看得出來;32px 幾乎分不出來
量化:DejaVu Sans 32px 前 300 字元, 72% 點陣圖有變化、平均高度差 0.88 px、最差 2 px
中文(CJK)字因為筆畫多,差異比英文更不明顯
如果你覺得小字糊到受不了,可以改用 -Dm2sfix.policy=detect :只處理被判定為惡意的那個字型, 其他字型保持原樣(代價是回到「只擋已知變種」)。
只有偵測到高危才會跳警告視窗 (一般字型只是安靜降級,不會打擾你):
按「中斷連線」會直接離開那個伺服器。不需要任何設定,也不影響遊戲效能。
想回到「只處理被判定為惡意字型」的舊行為(畫質優先): 在 JVM 參數加 -Dm2sfix.policy=detect 。
視窗裡 不會 顯示「它原本要執行什麼指令」。原因很實在:公開的那支攻擊程式把指令直接寫在 字型的程式碼裡組出來,144 個字型裡用任何編碼(ASCII/UTF-16/拆成 4 byte)都找不到 calc.exe ,沒有可靠辦法反推。與其顯示一個猜的,不如不顯示。
視窗裡 不會 顯示「它原本要執行什麼指令」。原因很實在:公開的那支攻擊程式把指令直接寫在 字型的程式碼裡組出來,144 個字型裡用任何編碼(ASCII/UTF-16/拆成 4 byte)都找不到 calc.exe ,沒有可靠辦法反推。與其顯示一個猜的,不如不顯示。
我直接對 Mojang 的版本清單(Piston meta)與實際的原生函式庫驗證過:
FreeType 的 Ins_SHZ 修補是 2026 年 4 月進上游、隨 2.15.0 (2026-10)釋出;上面三個版本樹全都早於它。
最新正式版 26.3 與最新快照 26.4-snapshot-10 都還是 lwjgl-freetype 3.4.3 ,所以官方還沒修。
1.20.4 以前的客戶端根本沒呼叫 FreeType,本工具掛上去也不會被觸發(不會壞,但也沒作用)。
舊版(1.20.5–1.21.x)跑的是 Java 21,本工具就是編 Java 21,可以直接用。
到 Releases 下載 m2sfix-agent-1.0.0.jar ,記住它放在哪
啟動器 →「安裝檔」→ 你的版本 →「編輯」→「更多選項」
在「JVM 參數」那欄最後面加上(路徑換成你放的位置): -javaagent:/你的路徑/m2sfix-agent-1.0.0.jar
下載 m2sfix-mod-1.0.0.jar ,丟進 .minecraft/mods/ 就好(不需要 Fabric API)。
同一顆 m2sfix-mod-1.0.0.jar 丟進 mods/ 。如果啟動器說載入失敗,改用上面的 -javaagent 方式,那個在任何啟動器都能用。
平常什麼都沒有=正常,代表沒遇到有問題的字型。
它只認得「已知的那一類手法」;之後如果出現寫法不同的新變種,可能抓不到
真正的解法是等 Minecraft 更新繪字引擎,這個工具只是過渡
沒有在真正的遊戲客戶端實測過(警告視窗也還沒在真遊戲裡看過)
掛點位置、偵測原理、設定選項、測試數據 → docs/HOW-IT-WORKS.md
攻擊是怎麼運作的(逐步拆解公開 PoC)→ docs/EXPLOIT-ANALYSIS.md
研究這個專案碰到什麼問題 → SECURITY.md
A client-side mitigation for the Minecraft "server resource pack font" attack — legitimate fonts look exactly the same .
⚠️ Not tested against a live Minecraft client (no Windows environment here). All verification is Java-level simulation. Treat it as a stopgap, not a vendor fix.
⚠️ Not tested against a live Minecraft client (no Windows environment here). All verification is Java-level simulation. Treat it as a stopgap, not a vendor fix.
This tool is a temporary workaround, not an official Mojang fix.
It may produce false positives and false negatives, and it cannot guarantee that it blocks every attack or that any warning it shows is correct.
The author accepts no liability for any direct or indirect financial loss or other consequences of false positives or false negatives; all responsibility rests with the user. If you do not agree, do not install it — just decline every server resource-pack request instead!
The problem, in plain words
A Minecraft server can send players a resource pack that contains a font. Someone figured out how to hide a malicious program inside such a font: the moment the game draws a character with it, the player's computer can be made to run arbitrary code. The flaw is in the font engine the game uses, and Minecraft has not shipped a fix yet.
Every font goes through a safe channel: glyph loading always skips the "hinting" step of the font engine. The attack only works because that step executes bytecode embedded in the font; skip it and the font's own program never runs. This needs no idea of what the attack looks like, so variants that are not public yet are covered too.
The cost is rendering quality: without hinting, small text looks slightly softer. That is the deliberate trade — a little sharpness for a whole class of bugs .
See exactly how much (top row = vanilla, bottom row = this tool):
Rendered with the same font engine Minecraft 26.3 ships (FreeType 2.14.3) , then zoomed with nearest-neighbour so individual pixels are visible — not a mock-up
HUD-sized 9 px text changes the most (softer edges, no longer pixel-aligned); 16 px is still noticeable; at 32 px you can barely tell
Measured on DejaVu Sans at 32 px, first 300 glyphs: 72% of bitmaps change, mean height difference 0.88 px, worst case 2 px
CJK text shows the difference even less, because dense strokes hide it
If the softness bothers you, switch to -Dm2sfix.policy=detect : only the font judged malicious is degraded and everything else stays vanilla (the cost is going back to "known variants only").
A warning dialog appears only for high-confidence hits (ordinary fonts are just quietly degraded):
"Disconnect" leaves that server immediately. No configuration, no measurable performance cost.
To go back to the old "only touch fonts judged malicious" behaviour (sharpness first), add -Dm2sfix.policy=detect to the JVM arguments.
The dialog deliberately does not show "the command it would have run". The published exploit builds its command inside the font's own bytecode: calc.exe appears in none of the 144 shipped fonts in any encoding (ASCII, UTF-16, 4-byte split), so there is no reliable way to recover it. Showing a guess would be worse than showing nothing.
The dialog deliberately does not show "the command it would have run". The published exploit builds its command inside the font's own bytecode: calc.exe appears in none of the 144 shipped fonts in any encoding (ASCII, UTF-16, 4-byte split), so there is no reliable way to recover it. Showing a guess would be worse than showing nothing.
Checked against Mojang's own version manifest (Piston meta) and the actual native libraries:
The Ins_SHZ fix landed upstream in April 2026 and shipped in 2.15.0 (2026-10); every version tree above predates it.
The latest release (26.3) and the latest snapshot (26.4-snapshot-10) still ship lwjgl-freetype 3.4.3 — Mojang has not shipped the fix yet.
Before 1.20.5 the client never calls FreeType, so the hooks are never reached (harmless, but no effect either).
1.20.5 – 1.21.x run Java 21, which is what this project targets, so they work as-is.
Download m2sfix-agent-1.0.0.jar from Releases
Launcher → Installations → your instance → Edit → More options
Append to "JVM arguments" (use your own path): -javaagent:/full/path/to/m2sfix-agent-1.0.0.jar
Drop m2sfix-mod-1.0.0.jar into .minecraft/mods/ (no Fabric API needed).
The same m2sfix-mod-1.0.0.jar goes into mods/ . If your loader refuses it, use the -javaagent route above — that works with every launcher.
A warning dialog appears when something is blocked, and the log shows one line per suspicious font:
Nothing at all is the normal case.
It recognises the known family of attacks; a differently built variant may slip through
The real fix is an upstream Minecraft update — this is a stopgap
Not tested in a real game client (the dialog has not been seen on screen either)
Untested on macOS / ARM
Hook points, detection logic, configuration, test data → docs/HOW-IT-WORKS.md
How the attack works, step by step → docs/EXPLOIT-ANALYSIS.md
Version history → CHANGELOG.md
Reporting a bypass → SECURITY.md
