4 ms·
> that's not enough as you can rebuild access to builtins from objects In this specific case, it's safe, as that wouldn't pass the regex just a few line before
by senko 2y ago
> that's not enough as you can rebuild access to builtins from objects
In this specific case, it's safe, as that wouldn't pass the regex just a few line before the eval :
# Define a regex pattern that only allows numbers,
# operators, parentheses, and whitespace
allowed_pattern = r'^[\d+\-*/().\s]+$'
Commenting on the R1 reproduction, the heavy lifting there is done by huggingface's trl[0] library, and the heavy use of compute.
[0] Transformer Reinforcement Learning - https://huggingface.co/docs/trl/en/index https://huggingface.co/docs/trl/en/index
- indrora 2y agoThe fact that () and . are there miiiight enable a pyjail escape. See also https://github.com/jailctf/pyjailbreaker https://github.com/jailctf/pyjailbreaker See also https://blog.pepsipu.com/posts/albatross-redpwnctf https://blog.pepsipu.com/posts/albatross-redpwnctf
- senko 2y agoThat's a neat trick! It does still require letters to be able to spell attribute/function names (unless I'm reading it wrong in that blog post).