mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-06 19:35:13 +02:00
20 lines
571 B
Python
20 lines
571 B
Python
# Regression fixture: asyncio coroutine with env-var source flowing
|
|||
# across an `await` boundary to a subprocess.run sink.
|
|||
#
|
|||
# Intended finding: taint-unsanitised-flow from os.environ["CMD"] to
|
|||
# subprocess.run (shell=True). The await point must not break taint
|
|||
# tracking — awaited expressions resume in the same stack frame and the
|
|||
# tainted variable is still in scope.
|
|||
import asyncio
|
|||
import os
|
|||
import subprocess
|
|||
|
|||
|
|||
async def fetch_and_exec():
|
|||
cmd = os.environ["CMD"]
|
|||
await asyncio.sleep(0)
|
|||
subprocess.run(cmd, shell=True)
|
|||
|
|||
|
|||
asyncio.run(fetch_and_exec())
|