Detection of base64 decode + exec.
(self)
| 241 | assert any(f.rule_id == "SC2" for f in findings) |
| 242 | |
| 243 | def test_sc3_base64_exec(self) -> None: |
| 244 | """Detection of base64 decode + exec.""" |
| 245 | content = """ |
| 246 | import base64 |
| 247 | exec(base64.b64decode("aW1wb3J0IG9z")) |
| 248 | """ |
| 249 | findings = supply_chain_module.analyze(content, "script.py", "python") |
| 250 | assert len(findings) >= 1 |
| 251 | assert any(f.rule_id == "SC3" for f in findings) |
| 252 | |
| 253 | def test_sc3_marshal_loads(self) -> None: |
| 254 | """Detection of marshal.loads.""" |