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

Multiple Local Code Executions (using Pickle) #529

Open
nttoole opened this issue May 24, 2024 · 2 comments
Open

Multiple Local Code Executions (using Pickle) #529

nttoole opened this issue May 24, 2024 · 2 comments

Comments

@nttoole
Copy link
Contributor

nttoole commented May 24, 2024

AIT-Core extensively uses Pickle. As per Python documentation, this library is insecure and allows bad actors to achieve Command Execution. One example is loading a leap seconds configuration file, part of the DMC module. According to AIT-Core documentation, the ait.dmc module provides utilities to represent, translate, and manipulate time, building upon Python's datetime and timedelta data types. When the leapseconds.dat file is loaded, AIT-Core uses Pickle to process the file (see Figure 13).

1716277313654

Figure 13: AIT-Core processes the leapseconds.dat using Pickle.

If the bad actors can access the AIT-Core configuration file, they can change it to point to their malicious pickle file (see Figure 14), which will then be executed by the AIT-Core DMC module (see Figure 15).

1716277336075

Figure 14: Example of a malicious Pickle file.

1716277352073

Figure 15: AIT-Core DMC loads the malicious Pickle file.

Other areas where the pickle is used and can lead to Local Command Execution are the following modules:

  • Table
  • Util
  • Data Archive
  • Limit Monitor
  • Open MCT Plugin

Recommendations

The pickle library is insecure and can lead to Command Execution vulnerabilities. Therefore, it should not be used, or the content of the loaded pickle files should be sanitised. This is just one example of how AIT-Core utilises the Pickle library, which we decided to use to demonstrate how it can be exploited.

@nttoole nttoole changed the title Resolve secuity issue: Multiple Local Code Executions (using Pickle) Address secuity issue: Multiple Local Code Executions (using Pickle) May 24, 2024
@nttoole nttoole changed the title Address secuity issue: Multiple Local Code Executions (using Pickle) Multiple Local Code Executions (using Pickle) Jun 13, 2024
@PaulMRamirez
Copy link

@nttoole I'm gathering there is a patch in progress to remove pickle usage. If we've stored files in the Pickle compressed format we should provide a script somewhere or commands on how to un "pickle" those files.

@nttoole
Copy link
Contributor Author

nttoole commented Sep 10, 2024

@MJJoyce 's command of choice:

find . -name "*.pkl" -exec rm {} \;

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

No branches or pull requests

2 participants