Skip to content

Conversation

@mhucka
Copy link
Contributor

@mhucka mhucka commented Nov 21, 2025

This is an attempt to address code scanning alert #567 about unsafe deserialization of user-provided data. This adds some checking around the unmarshaling of stored operators.

This is an attempt to address [code scanning alert quantumlib#567](
https://github.com/quantumlib/OpenFermion/security/code-scanning/567)
about unsafe deserialization of user-provided data. This adds some
checking around the unmarshaling of stored operators.
@mhucka mhucka changed the base branch from mh-fix-marshal-security-warning to main November 24, 2025 16:42
Copy link
Contributor

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The marshal.load call is inherently insecure and as such it cannot be fixed by post-call checks.

We can either leave it as is and require that load_operator is used only on trusted data (ie, update docstring) OR deprecate and eventually remove loading of marshal files and only allow the plain_text format.

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.

2 participants