Skip to content

Conversation

@Mysteryem
Copy link
Contributor

@Mysteryem Mysteryem commented May 6, 2025

Hooks and modifications to the manual world itself are expected places that could run any python code. What is not expected is json rules themselves running python code when being parsed.

Due to the use of eval(), function arguments within json rules could have run arbitrary code.

The use of eval has been replaced with ast.literal_eval, ensuring that function arguments being parsed in json rules cannot run arbitrary Python code.


Json rules should be considered 'safe', not requiring any sort of review, in my opinion. Without this change, json rules are currently 'unsafe' and would have to be reviewed alongside any hooks a custom manual world adds, or any changes a custom manual world makes to the base manual world.

As a note, the code that is using eval is not present in any stable or unstable releases of Manual yet.

Hooks and modifications to the manual world itself are expected places
that could run any python code. What is not expected is json rules
themselves running python code while being parsed.

Due to the use of `eval()`, function arguments within json rules could
have run arbitrary code while being parsed.

The use of `eval` has been replaced with `ast.literal_eval`, ensuring
that function arguments being parsed in json rules cannot run arbitrary
Python code.
@silasary
Copy link
Collaborator

silasary commented May 6, 2025

Good catch :)

@silasary silasary merged commit 43c69a5 into ManualForArchipelago:main May 7, 2025
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.

3 participants