Skip to content

Usage of literal_eval considered unsafe #710

Closed
@kevinkupski

Description

@kevinkupski

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions