Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of literal_eval considered unsafe #710

Open
kevinkupski opened this issue Jan 24, 2025 · 2 comments
Open

Usage of literal_eval considered unsafe #710

kevinkupski opened this issue Jan 24, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@kevinkupski
Copy link

The chat models currently use literal_eval to parse messages.

The official Python documentation states:

Warning It is possible to crash the Python interpreter due to stack depth limitations in Python’s AST compiler.

Also official CPython contributor vstinner states:

It was never safe.

Since messages clearly contain user input, we currently consider this an issue which prevents us from using this implementation in production. Are there any plans to rework this part of the code and eliminate the literal_eval?

@langcarl langcarl bot added the investigate label Jan 24, 2025
@kevinkupski
Copy link
Author

Might also relate to #694

@lkuligin
Copy link
Collaborator

yes, adding a flag would help with that.

@lkuligin lkuligin added enhancement New feature or request and removed investigate labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants