[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
a965f01a6e
commit
7ee6993c7d
2 changed files with 6 additions and 2 deletions
|
|
@ -694,7 +694,11 @@ def test_sandboxed_pyc_only_workdir_module_import_denied():
|
|||
session = "backstop-workdir-pyc"
|
||||
workdir = get_sandbox_workdir(session)
|
||||
src = "import os\nos.system('echo PWNED_PYC')\n"
|
||||
pyc = importlib.util.MAGIC_NUMBER + (b"\x00" * 12) + marshal.dumps(compile(src, "evilpyc.py", "exec"))
|
||||
pyc = (
|
||||
importlib.util.MAGIC_NUMBER
|
||||
+ (b"\x00" * 12)
|
||||
+ marshal.dumps(compile(src, "evilpyc.py", "exec"))
|
||||
)
|
||||
target = os.path.join(workdir, "evilpyc.pyc")
|
||||
with open(target, "wb") as f:
|
||||
f.write(pyc)
|
||||
|
|
|
|||
|
|
@ -4162,7 +4162,7 @@ class TestRound39Bypasses:
|
|||
"code",
|
||||
[
|
||||
# A $() / backtick substitution runs inside DOUBLE quotes, so a reader payload leaks.
|
||||
'import os\nos.system(\'echo "$(cat /etc/passwd)"\')',
|
||||
"import os\nos.system('echo \"$(cat /etc/passwd)\"')",
|
||||
"import os\nos.system('echo \"`cat /etc/passwd`\"')",
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue