Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

huggingface/peft
main @ 173bf1c
3
Fixes
0
CVEs
CRITICAL
Peak severity
66.7%
Coverage
Highlights
Remote Code Execution: 3 prior fixes. Scrutinize any change in this area.
method_comparison/app.py: most-fixed (1 issue). Treat as high-risk during review.
3 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Remote Code Execution: User-supplied queries were directly evaluated using pandas.DataFrame.query, allowing arbitrary python code execution. This required introducing an AST-based safe evaluator to sanitize inputs.
Remote Code Execution: Malicious adapter configurations could trigger arbitrary module execution through untrusted package imports. This was mitigated by introducing an import allowlist in the AutoPeftModel initialization path.
Remote Code Execution: Allowing untrusted configurations to pass the trust_remote_code parameter to AutoTokenizer.from_pretrained can lead to arbitrary code execution when loading remote tokenizers. The fix explicitly pops this parameter from the tokenizer arguments.