Skip to content

Security: Use of eval() on file contents#718

Merged
nicholasserra merged 1 commit into
trentm:masterfrom
tomaioo:fix/security/use-of-eval-on-file-contents
Jul 21, 2026
Merged

Security: Use of eval() on file contents#718
nicholasserra merged 1 commit into
trentm:masterfrom
tomaioo:fix/security/use-of-eval-on-file-contents

Conversation

@tomaioo

@tomaioo tomaioo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Security: Use of eval() on file contents

Problem

Severity: High | File: perf/strip_cookbook_data.py:L8

The doit() function in perf/strip_cookbook_data.py uses eval(f.read()) to parse the contents of a file. If the file is untrusted or compromised, this could lead to arbitrary code execution.

Solution

Replace eval() with a safe deserialization format like json.loads() or ast.literal_eval().

Changes

  • perf/strip_cookbook_data.py (modified)

The `doit()` function in `perf/strip_cookbook_data.py` uses `eval(f.read())` to parse the contents of a file. If the file is untrusted or compromised, this could lead to arbitrary code execution.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@nicholasserra
nicholasserra merged commit 8422475 into trentm:master Jul 21, 2026
18 checks passed
@nicholasserra

Copy link
Copy Markdown
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants