そのプロンプト、本当に "a" ですか? ホモグリフ攻撃がLLMアプリを騙す仕組みと防御実装
Zenn / 4/18/2026
💬 OpinionDeveloper Stack & InfrastructureTools & Practical Usage
Key Points
- ホモグリフ(見た目が似た文字)を用いて「a」に見える入力を別文字にすり替え、LLMアプリの挙動を意図せず変えられる攻撃手法を説明しています。
- アプリ側の文字列処理・検証が不十分だと、プロンプトやガードレールの判定がすり抜けるメカニズムを整理しています。
- 防御として、Unicode正規化(例:NFKC等)や文字種の正規化、許可リスト方式、入力検証を組み合わせる実装方針を提示しています。
- LLM利用時のセキュリティ観点として、視覚的同一性だけに依存しない実装とテスト(攻撃入力の再現)を推奨しています。
そのプロンプト、本当に "a" ですか? ホモグリフ攻撃がLLMアプリを騙す仕組みと防御実装
TL;DR
LLMアプリに組み込んだキーワードフィルターが、Unicode 攻撃・ホモグリフ置換によって無効化される。本記事では Python の unicodedata モジュールと Confusables データベースを使った検出・正規化の実装を動くコードつきで解説する。読了目安は15分、手元で試せるコードを全て掲載している。
ホモグリフとは何か — 人間の目とLLMを同時に欺く文字の話
ホモグリフ(homoglyph)とは、見た目が似ているが異なるコードポイントを持つ文字同士を指...
Continue reading this article on the original site.
Read original →💡 Insights using this article
This article is featured in our daily AI news digest — key takeaways and action items at a glance.
Related Articles

Black Hat USA
AI Business

Black Hat Asia
AI Business

I Tested Every AI Writing Tool for 30 Days — Here's What Won
Dev.to

How Filipino developers are beating $20/month AI costs with P112/month (SimplyLouie PH)
Dev.to
![easyaligner: Forced alignment with GPU acceleration and flexible text normalization (compatible with all w2v2 models on HF Hub) [P]](/_next/image?url=https%3A%2F%2Fpreview.redd.it%2Ff4d5krhkjyvg1.png%3Fwidth%3D140%26height%3D46%26auto%3Dwebp%26s%3Db704f6e672544b79bafac59f00c49f9f56a3fa6c&w=3840&q=75)
easyaligner: Forced alignment with GPU acceleration and flexible text normalization (compatible with all w2v2 models on HF Hub) [P]
Reddit r/MachineLearning