Skip to content

Conversation

@acuanico-tr-galt
Copy link
Collaborator

Issue being resolved: Security improvement on FieldsParser

Solution description

ast.literal_eval() solves a security and reliability problem that arises when using eval() in Python. It safely parses a string containing only Python literal structures

Changes

Replaced eval(value) with ast.literal_eval(value), which is much safer as it only allows Python literals (strings, numbers, tuples, lists, dicts, booleans, and None) to be parsed.

Potential impacts

None

PR Tasks

  • PR reference added to issue
  • README updated
  • Unit tests added/updated

@acuanico-tr-galt acuanico-tr-galt self-assigned this May 6, 2025
@acuanico-tr-galt acuanico-tr-galt merged commit 07d49db into main May 7, 2025
8 checks passed
@acuanico-tr-galt acuanico-tr-galt deleted the bugfix/TR-13583 branch June 27, 2025 07:54
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.

1 participant