LibreChat RAG API にログインジェクションの脆弱性
独立行政法人情報処理推進機構(IPA)および一般社団法人JPCERT コーディネーションセンター(JPCERT/CC)は3月25日、LibreChat RAG APIにおけるログインジェクションの脆弱性について「Japan Vulnerability Notes(JVN)」で発表した。影響を受けるシステムは以下の通り。
LibreChat RAG API バージョン 0.7.0
LibreChat RAG APIは、FastAPIとLangChainを用いて構築された非同期バックエンドサービスとして設計されており、PostgreSQLのpgvector拡張と連携してドキュメントベースのRAG(検索拡張生成)機能を提供しているが、同機能では、ユーザーからの入力が適切に無害化されずにログファイルに出力されているため、POSTリクエストのフォームデータ内のfile_idパラメーターに改行文字を挿入することで、ログエントリの改ざんが可能となっている。
想定される影響としては、認証された攻撃者によってログが操作され、悪意のある活動の隠蔽、フォレンジック調査の妨害、他のユーザーへのなりすましが行われる可能性がある。また、改ざんされたログがウェブベースの管理コンソールや安全でないログ管理ツールを通じて閲覧された場合、クロスサイトスクリプティング(XSS)やリモートコード実行などの二次的な攻撃につながる可能性がある。
JVNでは、下記のワークアラウンドを組み合わせて実施することで、本脆弱性の影響を軽減することが可能と案内している。
・RAGへの取り込み処理において、悪意のあるデータが入力ログに記録されないように無害化する ・使用していない場合は、PostgreSQLのpgvector拡張機能を無効にする ・RAGの出力を他のツールに渡す前に検証し、間接的なプロンプトインジェクションにつながるおそれのあるデータの転送を防止する
LibreChat RAG API バージョン 0.7.0
LibreChat RAG APIは、FastAPIとLangChainを用いて構築された非同期バックエンドサービスとして設計されており、PostgreSQLのpgvector拡張と連携してドキュメントベースのRAG(検索拡張生成)機能を提供しているが、同機能では、ユーザーからの入力が適切に無害化されずにログファイルに出力されているため、POSTリクエストのフォームデータ内のfile_idパラメーターに改行文字を挿入することで、ログエントリの改ざんが可能となっている。
想定される影響としては、認証された攻撃者によってログが操作され、悪意のある活動の隠蔽、フォレンジック調査の妨害、他のユーザーへのなりすましが行われる可能性がある。また、改ざんされたログがウェブベースの管理コンソールや安全でないログ管理ツールを通じて閲覧された場合、クロスサイトスクリプティング(XSS)やリモートコード実行などの二次的な攻撃につながる可能性がある。
JVNでは、下記のワークアラウンドを組み合わせて実施することで、本脆弱性の影響を軽減することが可能と案内している。
・RAGへの取り込み処理において、悪意のあるデータが入力ログに記録されないように無害化する ・使用していない場合は、PostgreSQLのpgvector拡張機能を無効にする ・RAGの出力を他のツールに渡す前に検証し、間接的なプロンプトインジェクションにつながるおそれのあるデータの転送を防止する
Vocabulary
General
Proper noun
JLPT N2
JLPT N1
| # | 言葉 | 意味 |
|---|---|---|
| 3 | 影響 | えいきょう (影響) : 1. influence; effect 2. to influence; to affect; to have an influence on; to impact; to have an effect on |
| 2 | 脆弱性 | ぜいじゃくせい (脆弱性) : vulnerability; weakness; fragility |
| 2 | 機能 | きのう (機能) : function; facility; faculty; feature |
| 2 | 入力 | にゅうりょく (入力) : input; (data) entry |
| 2 | 出力 | しゅつりょく (出力) : output (electrical, signal, etc.) |
| 2 | 改ざん | かいざん (改ざん) : alteration; falsification; faking |
| 2 | 可能 | かのう (可能) : possible; potential; practicable; feasible |
| 2 | 悪意 | あくい (悪意) : 1. ill will; spite; evil intention; malice 2. bad meaning |
| 2 | 他 | ほか (他) : 1. other (place, thing, person); the rest 2. outside; beyond |
| 2 | 可能性 | かのうせい (可能性) : potentiality; likelihood; possibility; availability |
| 2 | つながる | つながる (繋がる) : 1. to be tied together; to be connected to; to be linked to 2. to lead to; to be related to |
| 1 | 独立行政法人 | どくりつぎょうせいほうじん (独立行政法人) : independent administrative corporation (institution, agency) |
| 1 | 情報処理推進機構 | じょうほうしょりすいしんきこう (情報処理推進機構) : Information-technology Promotion Agency (organization) |
| 1 | および | および (及び) : and; as well as |
| 1 | 一般社団法人 | いっぱんしゃだんほうじん (一般社団法人) : general incorporated association |
| 1 | 発表 | はっぴょう (発表) : announcement; publication; presenting; statement; communique; making known; breaking (news story); expressing (one's opinion); releasing; unveiling |
| 1 | 通り | とおり (通り) : 1. avenue; street; way; road 2. coming and going; street traffic |
| 1 | 用いる | もちいる (用いる) : to use; to make use of; to utilize; to utilise |
| 1 | 構築 | こうちく (構築) : construction; building; putting up; erecting; creation; formulation; architecture (systems, agreement, etc.) |
| 1 | 非同期 | ひどうき (非同期) : asynchronous |
| 1 | 設計 | せっけい (設計) : plan; design; layout |
| 1 | 拡張 | かくちょう (拡張) : 1. expansion; extension; enlargement 2. escape; ESC |
| 1 | 連携 | れんけい (連携) : cooperation; coordination; link |
| 1 | 提供 | ていきょう (提供) : 1. offer; tender; providing; supplying; making available; donating (blood, organs, etc.) 2. sponsoring (a TV program) |
| 1 | 適切 | てきせつ (適切) : appropriate; suitable; fitting; apt; proper; right; pertinent; relevant |
| 1 | 改行 | かいぎょう (改行) : 1. new line; new paragraph 2. newline (e.g. LF, CR, CRLF) |
| 1 | 文字 | もじ (文字) : 1. letter (of alphabet); character 2. writing |
| 1 | 挿入 | そうにゅう (挿入) : insertion; incorporation; infixing |
| 1 | 想定 | そうてい (想定) : hypothesis; supposition; assumption |
| 1 | 認証 | にんしょう (認証) : 1. certification; attestation; authentication; confirmation 2. Imperial attestation |
| 1 | 攻撃者 | こうげきしゃ (攻撃者) : aggressor; assailant; invader |
| 1 | 操作 | そうさ (操作) : 1. operation; management; handling 2. manipulating (to one's benefit); manipulation; influencing |
| 1 | 活動 | かつどう (活動) : 1. activity (of a person, organization, animal, volcano, etc.); action 2. movie (esp. during the silent movie period) |
| 1 | 隠蔽 | いんぺい (隠蔽) : concealment; suppression; hiding |
| 1 | 調査 | ちょうさ (調査) : investigation; examination; inquiry; enquiry; survey |
| 1 | 妨害 | ぼうがい (妨害) : disturbance; obstruction; hindrance; jamming; interference |
| 1 | なりすます | なりすます (成りすます) : to pose as; to impersonate |
| 1 | 管理 | かんり (管理) : control; management (e.g. of a business) |
| 1 | 管理ツール | かんりツール (管理ツール) : management tool |
| 1 | 通ずる | つうずる (通ずる) : 1. to be open (to traffic); to lead to; to communicate (with) 2. to flow (liquid, current); to pass; to get through to |
| 1 | 閲覧 | えつらん (閲覧) : 1. inspection; reading; perusal 2. browsing (the web) |
| 1 | 実行 | じっこう (実行) : execution (e.g. of a plan); carrying out; practice; action; implementation; fulfillment; realization |
| 1 | 攻撃 | こうげき (攻撃) : 1. attack; assault; raid; onslaught; offensive 2. criticism; censure; denunciation; condemnation |
| 1 | 下記 | かき (下記) : the following |
| 1 | 組み合わせる | くみあわせる (組み合わせる) : to join together; to combine; to join up |
| 1 | 実施 | じっし (実施) : enforcement; implementation; putting into practice; carrying out; operation; working (e.g. working parameters); enactment |
| 1 | 軽減 | けいげん (軽減) : abatement; reduction |
| 1 | 取り込み | とりこみ (取り込み) : 1. taking in; bringing in 2. capturing (e.g. customers); attracting; winning over; pleasing |
| 1 | 処理 | しょり (処理) : processing; dealing with; treatment; disposition; disposal |
| 1 | 記録 | きろく (記録) : 1. record; minutes; document 2. record (e.g. in sports); results; score |
| 1 | 使用 | しよう (使用) : use; application; employment; utilization; utilisation |
| 1 | 拡張機能 | かくちょうきのう (拡張機能) : expanded functionality; extended functionality; expansion (software) |
| 1 | 無効 | むこう (無効) : invalid; void; ineffective; unavailable |
| 1 | 検証 | けんしょう (検証) : verification; inspection |
| 1 | 間接 | かんせつ (間接) : indirection; indirectness |
| 1 | おそれ | おそれ (恐れ) : fear; horror; anxiety; concern; uneasiness; reverence |
| 1 | 転送 | てんそう (転送) : transfer; redirection; transmission; forwarding (telephone call, e-mail, etc.) |
| 1 | 防止 | ぼうし (防止) : prevention; check |