Skip to content

Commit f286895

Browse files
sytelusclaude
andcommitted
fix unsafe YAML deserialization and expand security notice
Switch yaml_ordered_load default from yaml.Loader to yaml.SafeLoader to prevent arbitrary object instantiation (CWE-502). Update README security notice with CWE references and YAML deserialization guidance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9bc973b commit f286895

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,21 @@ TensorWatch supports Python 3.x and is tested with PyTorch 0.4-1.x. Most feature
8585
> yourself or that come from a source you fully trust.**
8686
> - Treat TensorWatch data files with the same caution as executable scripts.
8787
>
88-
> #### 4. Summary of Precautions
88+
> #### 4. YAML Deserialization
89+
>
90+
> The bundled `hiddenlayer` utilities include YAML loading functions. These use
91+
> `yaml.SafeLoader` by default to prevent arbitrary Python object instantiation
92+
> from YAML files. Do not override the loader with `yaml.Loader` or
93+
> `yaml.UnsafeLoader` when processing untrusted YAML input.
94+
>
95+
> #### 5. Summary of Precautions
8996
>
9097
> | Risk | Mitigation | User Action |
9198
> |------|-----------|-------------|
9299
> | `eval()` on expressions from clients | HMAC auth + localhost binding | Never expose ports to untrusted networks |
93100
> | `pickle.loads()` from ZMQ | HMAC + RestrictedUnpickler | Keep HMAC key secret |
94101
> | `pickle.load()` from files | RestrictedUnpickler (defense-in-depth) | Only load trusted files |
102+
> | YAML deserialization | `yaml.SafeLoader` by default | Do not override with unsafe loaders |
95103
> | ZMQ port exposure | Binds to `127.0.0.1` by default | Do not change to `0.0.0.0` in untrusted environments |
96104
97105
## How to Use It

0 commit comments

Comments
 (0)