Upload 2 files
Browse files- .gitattributes +1 -0
- README.md +49 -0
- malicious.tensors +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
malicious.tensors filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- security
|
| 5 |
+
- proof-of-concept
|
| 6 |
+
- tensorizer
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Tensorizer uninitialized-memory-disclosure PoC
|
| 10 |
+
|
| 11 |
+
This repository contains a proof-of-concept `.tensors` file for a responsibly-disclosed
|
| 12 |
+
vulnerability in [`coreweave/tensorizer`](https://github.com/coreweave/tensorizer) (tested at
|
| 13 |
+
commit `652d3c016c84836bba97153e108821c11428ac40`, version `2.12.1`), reported via huntr's
|
| 14 |
+
Model File Vulnerability program.
|
| 15 |
+
|
| 16 |
+
## What this file is
|
| 17 |
+
|
| 18 |
+
`malicious.tensors` is a syntactically valid Tensorizer file whose header/metadata index declares
|
| 19 |
+
one tensor (`poc_tensor`, 200,000 bytes of `float32` data), but whose data section has been
|
| 20 |
+
truncated to only 50,000 real bytes. The declared `data_length` for the tensor is left unchanged.
|
| 21 |
+
|
| 22 |
+
## What happens when you load it
|
| 23 |
+
|
| 24 |
+
```python
|
| 25 |
+
from tensorizer import TensorDeserializer
|
| 26 |
+
|
| 27 |
+
d = TensorDeserializer("malicious.tensors", verify_hash=False, lazy_load=False)
|
| 28 |
+
t = d["poc_tensor"] # succeeds -- no exception is raised
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
`TensorDeserializer` allocates the tensor's backing buffer with `torch.empty(...)` (uninitialized
|
| 32 |
+
memory) sized to the *declared* `data_length`, reads however many bytes are actually available
|
| 33 |
+
from the stream via `readinto()`, and never checks that the number of bytes read matches what was
|
| 34 |
+
requested. The 150,000 bytes that were never physically present in the file are left as whatever
|
| 35 |
+
was already sitting in that memory region of the host process — not zeroed, not an error.
|
| 36 |
+
|
| 37 |
+
Depending on what the host process had recently allocated, this can expose residual heap contents
|
| 38 |
+
(other in-process data) as if it were part of the loaded tensor's legitimate weights, with no
|
| 39 |
+
indication to the caller that anything is wrong.
|
| 40 |
+
|
| 41 |
+
See the reporter's full write-up submitted via huntr for the complete technical analysis,
|
| 42 |
+
including a reproduction that deliberately "dirties" the process heap with a recognizable byte
|
| 43 |
+
pattern beforehand and shows that pattern reappearing verbatim in the loaded tensor's data.
|
| 44 |
+
|
| 45 |
+
## Scope note
|
| 46 |
+
|
| 47 |
+
This PoC is provided solely for the purpose of responsible vulnerability disclosure and
|
| 48 |
+
reproduction by the `tensorizer` maintainers / huntr triage team. It is not intended for any other
|
| 49 |
+
use.
|
malicious.tensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08ef0eaf061205d9cd89bdafea0c504de181cdad2bbce8818a3ce6e4ac353b69
|
| 3 |
+
size 312308
|