Repository navigation
Conversation
|
@ZX-ModelCloud review this |
There was a problem hiding this comment.
One security issue remains: reject manifest-controlled UNC/absolute paths before resolving them.
resolve_checkpoint_adapter_path() detects Windows absolute paths with ntpath.isabs(path), but keeps them as candidate and then calls candidate.resolve(strict=True). On Windows, resolving a value such as \\server\share\adapter can perform a network-filesystem lookup before the checkpoint-containment check.
Because this value comes from quantize_config.json and must remain inside the checkpoint, please reject POSIX and Windows absolute paths (including UNC and drive-qualified paths) before any filesystem operation on that value. Add a regression test confirming that a UNC input is rejected without probing the UNC path.
This finding is limited to checkpoint metadata; explicit caller-supplied filesystem paths handled by resolve_path() may retain their existing semantics.
|
Pushed review fixes on top of this PR's commits: pin/digest pair enforced at the |
- Require the immutable revision and SHA-256 digest to be set as a pair at the Lora sink so a half-configured adapter can never fetch remote weights without integrity verification. - Reject traversal/host-path segments in remote repo ids, URL filenames, and repo subfolders before calling hf_hub_download. - Normalize explicit dict adapters in ModelLoader.from_quantized so configure_explicit_remote_adapter always sees a real Adapter instance. - Reject non-tensor lora_A/lora_B values in serialized adapter payloads so a manifest cannot inject adapter weights through Lora.__init__ kwargs. - Coerce os.PathLike adapter paths to str so pathlib callers keep working. - Document the explicit remote adapter opt-in/pinning flags in README. Regression tests cover checkpoint confinement (incl. absolute paths), pin/digest pairing, URL revision mismatches, subfolder traversal, dict payload injection, and pathlib adapter paths.
Summary
What Changed
Lora.post_init, including directQuantizeConfig.from_pretrained()usage. Reject absolute/UNC paths before probing them, directory symlinks, and external adapter-file links; preserve standard same-repository Hugging Face snapshot-to-blob links.blob.Tests
Review Requirements
Kernel Accuracy Requirements
Not applicable: no quantization arithmetic, packer, or inference-kernel changes.
Notes
models/auto.pyalso reports nine pre-existing E402 errors, verified onorigin/main; those unrelated lines are unchanged.Fixes #3407
Issue: #3407
Link to Devin session: https://app.devin.ai/sessions/97b37780f6244e329b0c413be902d772
Open in Devin Desktop: https://app.devin.ai/desktop/session/97b37780f6244e329b0c413be902d772?variant=devin
Requested by: @Qubitium