← Back

LibreChat RAG API にログインジェクションの脆弱性

Source
 独立行政法人情報処理推進機構(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の出力のツールに渡す前に検証し、間接的なプロンプトインジェクションにつながるおそれのあるデータの転送防止する

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