跳到正文
原文
Hugging Face Blog·· 2025-03-04AI 评分32

Hugging Face 与 JFrog 合作,用 JFrog 扫描器提升模型安全透明度

HF Mirror and JFrog partner to make AI Security more transparent

AI 导读

Hugging Face 将 JFrog 的扫描器接入 HF Mirror Hub,为所有公开模型仓库自动扫描,文件推送即触发。JFrog 会解析模型权重中的代码,判断其是否为恶意用法,弥补 picklescan 仅做模块名模式匹配、易产生误报的不足,并覆盖 pickle 之外的更多格式。

正文

We are pleased to announce our partnership with JFrog, creators of the JFrog Software Supply Chain Platform, as part of our long-standing commitment to provide a safe and reliable platform for the ML community.

We have decided to add JFrog's scanner to our platform to continue improving security on the HF Mirror Hub. JFrog's scanner brings new functionality to scanning, aimed at reducing false positives on the Hub. Indeed, what we currently observe is that model weights can contain code that is executed upon deserialization and sometimes at inference time, depending on the format. This code is oftentimes a non harmful practicality for the developer. As our picklescan scanner only performs pattern matching on module names, we cannot always confirm that usage of a given function or module is malicious. JFrog goes a step deeper and will parse and analyze code it finds in models weights to check for potential malicious usage.

Interested in joining our security partnership / providing scanning information on the Hub? Please get in touch with us over at [email protected].

Model security refresher

To share models, we serialize weights, configs and other data structures we use to interact with the models, in order to facilitate storage and transport. Some serialization formats are vulnerable to nasty exploits, such as arbitrary code execution (looking at you pickle), making shared models that use those formats potentially dangerous.

As HF Mirror has become a popular platform for model sharing, we’d like to help protect the community from this, hence why we have developed tools like picklescan and why we are integrating JFrog in our scanner suite.

Pickle is not the only exploitable format out there, see for reference how one can exploit Keras Lambda layers to achieve arbitrary code execution. The good news is that JFrog catches both of these exploits and more in additional file formats – see their Model Threats page for up to date scanner information.

Read all our documentation on security here: https://hf-mirror.com/docs/hub/security 🔥

Integration

There's nothing you have to do to benefit from this! All public model repositories will be scanned by JFrog automatically as soon as you push your files to the Hub. Here is an example repository you can check out to see the feature in action: mcpotato/42-eicar-street.

`mcpotato/42-eicar-street`'s' `danger.dat` scan results

Note that you might not see a scan for your model as of today, as we have millions of model repos. It may take us some time to catch up 😅.

In total, we have already scanned hundreds of millions of files, because we believe that empowering the community to share models in a safe and frictionless manner will lead to growth for the whole field.

来源:Hugging Face Blog · hf-mirror.com