StackGuardian / StackGuardian/tirith

refactor(core): replace `eval()` in the final-expression parser

Open
#303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chore
Dominant language
Python
Stars
165
Forks
42
Avg merge
1d 3h
Merged PRs (30d)
11

Description

eval_expression is evaluated with Python eval() (#172). Replace with a small parser
(ast.literal_eval is not enough — it needs boolean operators over evaluator ids) or a
whitelist-based ast walk. Security hygiene that must land before community-contributed policies
("policies from git", "policy packs").

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the eval_expression entry point and review issue #172 for the current Python eval() behavior. Define the allowed expression forms, including boolean operators over evaluator ids, and ensure the replacement cannot execute arbitrary code. Done means community-contributed policies can be evaluated without eval().

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.