Skip to content

Conversation

@vtomole
Copy link
Collaborator

@vtomole vtomole commented Mar 5, 2020

No description provided.

@vtomole vtomole requested a review from kevinsung March 5, 2020 19:03
kevinsung
kevinsung previously approved these changes Mar 5, 2020
@vtomole vtomole force-pushed the more_more_more_lint branch from fbe0c60 to af89fed Compare March 5, 2020 21:02
@kevinsung kevinsung merged commit ced9c09 into quantumlib:master Mar 6, 2020
philipp-q pushed a commit to philipp-q/OpenFermion that referenced this pull request Sep 2, 2020
…uantumlib#567)

* Fix merging-instance, unassigned expressions and redefined functions

* Format
mhucka added a commit that referenced this pull request Sep 24, 2025
CodeQL security [scan report #567](https://github.com/quantumlib/OpenFermion/security/code-scanning/567) flagged a data loading operation in `src/openfermion/utils/operator_utils.py` as being usafe due because it uses a user-provided value. The warning is about lines 282-283, involving the code

```python
with open(file_path, 'rb') as f:
    data = marshal.load(f)
```

> Deserializing untrusted data using any deserialization framework that allows the construction of arbitrary serializable objects is easily exploitable and in many cases allows an attacker to execute arbitrary code. Even before a deserialized object is returned to the caller of a deserialization method a lot of code may have been executed, including static initializers, constructors, and finalizers. Automatic deserialization of fields means that an attacker may craft a nested combination of objects on which the executed initialization code may have unforeseen effects, such as the execution of arbitrary code.
mhucka added a commit that referenced this pull request Sep 24, 2025
CodeQL security [scan report #567](https://github.com/quantumlib/OpenFermion/security/code-scanning/567) flagged a data loading operation in `src/openfermion/utils/operator_utils.py` as being usafe due because it uses a user-provided value. The warning is about lines 282-283, involving the code

```python
with open(file_path, 'rb') as f:
    data = marshal.load(f)
```

> Deserializing untrusted data using any deserialization framework that allows the construction of arbitrary serializable objects is easily exploitable and in many cases allows an attacker to execute arbitrary code. Even before a deserialized object is returned to the caller of a deserialization method a lot of code may have been executed, including static initializers, constructors, and finalizers. Automatic deserialization of fields means that an attacker may craft a nested combination of objects on which the executed initialization code may have unforeseen effects, such as the execution of arbitrary code.

This changes the code to use the `json` package instead of the `marshal` package and extracts the data more carefully.
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