You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ModelScan is an open source project from [Protect AI](https://protectai.com/) that scans models to determine if they contain
19
-
unsafe code. It is the first model scanning tool to support multiple model formats.
20
-
ModelScan currently supports: H5, Pickle, and SavedModel formats. This protects you
18
+
ModelScan is an open source project from [Protect AI](https://protectai.com/?utm_campaign=Homepage&utm_source=ModelScan%20GitHub%20Page&utm_medium=cta&utm_content=Open%20Source) that scans models to determine if they contain
19
+
unsafe code. It is the first model scanning tool to support multiple model formats.
20
+
ModelScan currently supports: H5, Pickle, and SavedModel formats. This protects you
21
21
when using PyTorch, TensorFlow, Keras, Sklearn, XGBoost, with more on the way.
Models are often created from automated pipelines, others may come from a data scientist’s laptop. In either case the model needs to move from one machine to another before it is used. That process of saving a model to disk is called serialization.
40
40
41
-
A **Model Serialization Attack** is where malicious code is added to the contents of a model during serialization(saving) before distribution — a modern version of the Trojan Horse.
41
+
A **Model Serialization Attack** is where malicious code is added to the contents of a model during serialization(saving) before distribution — a modern version of the Trojan Horse.
42
42
43
-
The attack functions by exploiting the saving and loading process of models. When you load a model with `model = torch.load(PATH)`, PyTorch opens the contents of the file and begins to running the code within. The second you load the model the exploit has executed.
43
+
The attack functions by exploiting the saving and loading process of models. When you load a model with `model = torch.load(PATH)`, PyTorch opens the contents of the file and begins to running the code within. The second you load the model the exploit has executed.
44
44
45
45
A **Model Serialization Attack** can be used to execute:
46
46
@@ -51,14 +51,27 @@ A **Model Serialization Attack** can be used to execute:
51
51
52
52
These attacks are incredibly simple to execute and you can view working examples in our 📓[notebooks](https://github.com/protectai/modelscan/tree/main/notebooks) folder.
53
53
54
+
## Enforcing And Automating Model Security
55
+
56
+
ModelScan offers robust open-source scanning. If you need comprehensive AI security, consider [Guardian](https://protectai.com/guardian?utm_campaign=Guardian&utm_source=ModelScan%20GitHub%20Page&utm_medium=cta&utm_content=Open%20Source). It is our enterprise-grade model scanning product.
57
+
58
+

59
+
60
+
### Guardian's Features:
61
+
62
+
1.**Cutting-Edge Scanning**: Access our latest scanners, broader model support, and automatic model format detection.
63
+
2.**Proactive Security**: Define and enforce security requirements for Hugging Face models before they enter your environment—no code changes required.
64
+
3.**Enterprise-Wide Coverage**: Implement a cohesive security posture across your organization, seamlessly integrating with your CI/CD pipelines.
65
+
4.**Comprehensive Audit Trail**: Gain full visibility into all scans and results, empowering you to identify and mitigate threats effectively.
66
+
54
67
## Getting Started
55
68
56
69
### How ModelScan Works
57
70
58
-
If loading a model with your machine learning framework automatically executes the attack,
71
+
If loading a model with your machine learning framework automatically executes the attack,
59
72
how does ModelScan check the content without loading the malicious code?
60
73
61
-
Simple, it reads the content of the file one byte at a time just like a string, looking for
74
+
Simple, it reads the content of the file one byte at a time just like a string, looking for
62
75
code signatures that are unsafe. This makes it incredibly fast, scanning models in the time it
63
76
takes for your computer to process the total filesize from disk(seconds in most cases). It also secure.
64
77
@@ -78,7 +91,7 @@ it opens you up for attack. Use your discretion to determine if that is appropri
78
91
79
92
### What Models and Frameworks Are Supported?
80
93
81
-
This will be expanding continually, so look out for changes in our release notes.
94
+
This will be expanding continually, so look out for changes in our release notes.
82
95
83
96
At present, ModelScan supports any Pickle derived format and many others:
84
97
@@ -90,7 +103,7 @@ At present, ModelScan supports any Pickle derived format and many others:
90
103
||[keras.models.save(save_format= 'keras')](https://www.tensorflow.org/guide/keras/serialization_and_saving)| Keras V3 (Hierarchical Data Format) | Yes |
0 commit comments