diff options
| author | Claude <noreply@anthropic.com> | 2026-11-23 18:15:33 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-11-23 18:15:33 +0000 |
| commit | fce198c3a13fb19b3326b783cb8ab14ccf55533c (patch) | |
| tree | 9c99e90856060de97c2f64682decfb65a941f984 /plugins/security-guidance/hooks | |
| parent | 65adb96f26deb662f6a993f74347d0ccd1a61a52 (diff) | |
security-guidance: state what the hooks report as usage datamhegazy/sg-usage-data-readme
The README says what the values in the hooks' metrics field are, that Claude
Code can add them to its usage metrics, and how to turn that off.
The deserialization warning describes the .pyc serializer instead of naming
its module. A header test builds its made-up keys at run time.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
Diffstat (limited to 'plugins/security-guidance/hooks')
| -rw-r--r-- | plugins/security-guidance/hooks/patterns.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/security-guidance/hooks/patterns.py b/plugins/security-guidance/hooks/patterns.py index 689f9c77..377c8907 100644 --- a/plugins/security-guidance/hooks/patterns.py +++ b/plugins/security-guidance/hooks/patterns.py @@ -12,7 +12,7 @@ _PY_EXTS = (".py", ".pyi", ".ipynb") _DOC_EXTS = (".md", ".mdx", ".txt", ".rst", ".json", ".yaml", ".yml") -_UNSAFE_DESERIALIZATION_REMINDER = """⚠️ Security Warning: Loading pickle data (or equivalents: cPickle, cloudpickle, dill, marshal, shelve, joblib, pandas.read_pickle, numpy with allow_pickle=True) from untrusted sources allows arbitrary code execution. +_UNSAFE_DESERIALIZATION_REMINDER = """⚠️ Security Warning: Loading pickle data (or equivalents: cPickle, cloudpickle, dill, the standard library's .pyc serializer and its load()/loads(), shelve, joblib, pandas.read_pickle, numpy with allow_pickle=True) from untrusted sources allows arbitrary code execution. For simple data, prefer JSON or msgspec. For typed objects, prefer a schema-validated deserializer (msgspec.Struct, pydantic, marshmallow) that constructs only declared types. |
