閱讀 MITRE ATLAS 中 AML.T0148「Embed Malicious Code in AI Artifacts」相關的 3 個 AI 資安案例,查看事件證據、適用範圍與 AIDEFEND 防禦分析。
風險分類說明
Adversaries may embed executable payloads in AI artifacts or their bundled components to cause malicious code to run when the artifacts are deserialized, loaded, used for training or inference, or otherwise processed. Payloads may be carried in serialized objects, executable model components, metadata, configuration files, or associated scripts. Execution depends on how the consuming software loads, interprets, or invokes the affected components. Adversaries may abuse serialization features of common model file formats that invoke code during object reconstruction, allowing payloads to execute during deserialization.[[python-pickle]] They may also place executable code in model layers, such as Keras Lambda layers, that run during loading, training, or inference while preserving expected model outputs.[[model-confusion]][[models-are-code]] Model computation graphs may contain operations that perform unauthorized file reads or writes through functionality supported by the AI framework.[[models-are-code]] Adversaries may place payloads in artifact metadata, configuration files, or templates that a loader or runtime interprets to invoke functions or evaluate code. Execution may result from unsafe configuration processing or vulnerabilities in template interpretation.[[model-metadata-rce]][[gguf-template-rce]] They may also embed malicious functionality in custom model implementations or scripts distributed with an artifact, which execute when the consuming workflow imports or invokes that code.[[custom-model-code]][[malhug]] Payloads may be concealed within model parameters or other artifact data and reconstructed by an embedded loader. Researchers demonstrated hiding a malware payload in tensor values and using code invoked during deserialization to recover and execute it.[[weaponizing-models]] An artifact may retain its expected AI functionality while the payload performs malicious actions. Activation may rely on [User Execution: Unsafe AI Artifacts](/techniques/AML.T0011.000), but may also be triggered by an adversary via [Exploit Automated Artifact Processing Pipeline](/techniques/AML.T0119) or [Event Triggered Execution](/techniques/AML.T0142).
資安研究人員 threlfall_hax(https://5stars217.github.io/)在公開模型儲存平台 Hugging Face 上,建立了幾個冒充真實公司的組織帳號。這些假的 Hugging Face 組織帳號看起來很正式,被冒充公司的員工因此主動申請加入,以為那就是公司內部用來分享模型的官方空間。這讓研究人員完整取得了員工上傳的所有 AI 模型,包括把模型替換成惡意版本的能力。研究人員也示範了他可以把惡意程式嵌進一個 AI 模型中,藉此進入受害組織的環境。從這裡開始,攻擊者就能發動一連串具破壞性的攻擊,例如竊取智慧財產,或毒害受害者環境中的其他 AI 模型。
Unit 42 的研究顯示,只要 Hugging Face 作者命名空間 (namespace, 模型平台上用來區分作者或組織所屬模型的名稱範圍)被刪除,或模型移轉後舊作者命名空間又變成可被他人註冊,下游程式碼、設定與文件裡未更新的模型參照就可能改指向攻擊者重新註冊的命名空間。研究人員在受控測試環境中註冊已被放棄的名稱、重建原本的模型路徑,讓 Vertex AI 與 Azure AI Foundry 部署流程載入含有反向 shell(由受影響環境主動連回外部、讓對方取得命令列)的模型;原作者帳號並未遭入侵。防禦方不能再把熟悉的名稱當成模型身分,而要以不可變的成品雜湊值與簽章者身分固定模型版本、監看命名空間生命週期、使用內部鏡像站,並隔離模型載入流程。