YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

orbax-checkpoint CWE-674 PoC

Severity: HIGH CWE-674 CVSS 7.5 Status: SUBMITTED

Target

Field Value
Package orbax-checkpoint
Version 0.11.40 (latest)
Commit a87ebc8
Platform huntr.com
CWE CWE-674 Uncontrolled Recursion
CVSS 7.5 High

Root Cause

_unchunk_array_leaves_in_place(d) in orbax/checkpoint/msgpack_utils.py recursively traverses a dict deserialized from a msgpack checkpoint file with no depth guard. A 1,001-level nested dict (3,009 bytes) triggers RecursionError.

def _unchunk_array_leaves_in_place(d):  # no depth guard
    for k, v in d.items():
        elif isinstance(v, dict):
            _unchunk_array_leaves_in_place(v)  # โ† unbounded recursion

Trigger Path

victim: checkpointer.restore(malicious_dir/)
  โ†’ MsgpackHandler.deserialize(dir/checkpoint)
  โ†’ msgpack_restore(bytes)
  โ†’ _unchunk_array_leaves_in_place(state_dict)  โ† RecursionError at depth 1001

Reproduce

pip install orbax-checkpoint msgpack
python3 poc_orbax.py

Expected output:

[*] Python recursion limit: 1000
[*] Payload: 3009 bytes, depth=1001
[+] CONFIRMED: RecursionError in _unchunk_array_leaves_in_place
[+] CONFIRMED via MsgpackHandler: maximum recursion depth exceeded

Fix

def _unchunk_array_leaves_in_place(d, _depth=0):
    if _depth > 500:
        raise ValueError('Checkpoint nesting depth exceeds limit')
    ...
    _unchunk_array_leaves_in_place(v, _depth + 1)

Files

File Purpose
poc_orbax.py Working PoC
submission.md Full technical writeup (markdown)
report.md Plain-prose paste target for huntr form
poc-evidence.html HTML evidence page with terminal output
README.md This file
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support