Tainted flow: 'dst' from os.environ.get (line 78, credential/environment) → shutil.copy (file write)
Medium
- Category
- Data Flow
- Content
shutil.copytree(s, dst) else: os.makedirs(os.path.dirname(dst), exist_ok=True) shutil.copy(s, dst) copied += 1 except Exception as e: print(" 复制失败 %s: %s" % (s, e))- Confidence
- 83% confidence
- Finding
- The destination path used for copying is rooted in SB, which is derived from the TEMP environment variable. An attacker who can influence the process environment can redirect the recovery sandbox to an arbitrary filesystem location, causing this script in --execute mode to write recovered files outside the intended temp area. In this recovery context, the copied data includes identity, memory, expert package, connector metadata, and workspace snapshots, so misdirected writes could disclose sensitive data or overwrite files in unexpected locations.
