Credential Access
- Category
- Privilege Escalation
- Confidence
- 96% confidence
- Finding
The matched extension check is intended to prevent credential disclosure, not steal credentials, but it runs only after files have been written and the ZIP closed. Nonhidden .pem or .key files can therefore enter the distribution archive, and fail() leaves that sensitive archive on disk, where subsequent collection or distribution could expose it despite the failed build.
- Content
python zf.write(fp, arcname) added.append(arcname) leaked = [a for a in added if a.endswith(('.pem', '.key', '.env', '.zip')) or 'deploy_config' in a] if leaked: fail(f'交付包内出现敏感文件,已中止: {leaked}') size = os.path.getsize(zip_path)
