Repository navigation
Conversation
…nsor reads Length and count fields read from a GGUF file were trusted before allocating, metadata arrays could nest without limit, and load_tensor sliced and sized buffers from unchecked offsets and shapes. Reject lengths larger than the remaining input, cap tensor rank and array nesting depth, and check tensor offset/shape against the data with checked arithmetic. Adds regression tests for each case. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01MfPHVKN9EKtoRQnmuZ2jpz
…sting Metadata and tensor counts read from a GGUF file were used directly as reserve capacities, tensor rank was unchecked before allocating the shape, and metadata arrays could nest without limit. Cap up-front reservations, reject ranks above 8 and arrays nested deeper than 8. Adds regression tests for each case. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01MfPHVKN9EKtoRQnmuZ2jpz
|
The The same job fails the same way on #1544 (2026-11-27) and #1543 (2026-11-26), which touch unrelated files. This PR changes only Fixing this needs a change to The Generated by Claude Code |
RuVLLM CPU microbenchmarks (macOS ARM64)Features: coreml, accelerate. The ane_bench_results.txtmatmul_bench_results.txtattention_bench_results.txt |
Daily security hardening: input bounds for the two GGUF model-file parsers. Model files are often downloaded from third-party hubs, so length and count fields in them are untrusted.
1.
crates/ruvector-sparse-inference/src/model/gguf.rs(also reached through theruvector-sparse-inference-wasmconstructor)load_tensornow uses checked arithmetic for the offset and element count, and rejects shapes that need more data than the file holds.model::gguf::tests:parse_rejects_string_length_beyond_input,parse_rejects_array_length_beyond_input,parse_rejects_deeply_nested_arrays,parse_rejects_excessive_tensor_rank,load_tensor_rejects_offset_past_endandload_tensor_rejects_shape_larger_than_dataall fail on the current code.parse_accepts_shallow_nested_arraysandload_tensor_reads_valid_f32check that valid input still parses.cargo test -p ruvector-sparse-inferencepasses: 99 + 10 tests.2.
crates/ruvllm/src/gguf/parser.rs(used byruvllm-cliand theruvllmmodel loader)gguf::parser::tests:parse_metadata_does_not_trust_count_for_allocation,parse_tensor_infos_does_not_trust_count_for_allocation,parse_tensor_infos_rejects_excessive_rankandparse_metadata_rejects_deeply_nested_arraysall fail on the current code.parse_metadata_accepts_shallow_nested_arrayschecks that valid input still parses.cargo test -p ruvllm --libpasses: 1618 tests.ruvllm-clibuilds.Note:
crates/ruvector-sparse-inference-wasm/Cargo.tomlalready fails to parse on main, because it uses workspace inheritance outside the workspace. That is unrelated to this PR, so the wasm wrapper was not rebuilt here.🤖 Generated with claude-flow
https://claude.ai/code/session_01MfPHVKN9EKtoRQnmuZ2jpz
Generated by Claude Code