Skip to content

chore: update inline imports to just look for process spawning, file writes, and environment modification to reduce fps#1322

Merged
art1f1c3R merged 2 commits intomainfrom
art1f1c3R/inline-import-os-fps
Mar 9, 2026
Merged

chore: update inline imports to just look for process spawning, file writes, and environment modification to reduce fps#1322
art1f1c3R merged 2 commits intomainfrom
art1f1c3R/inline-import-os-fps

Conversation

@art1f1c3R
Copy link
Member

@art1f1c3R art1f1c3R commented Mar 9, 2026

Summary

In many recent runs of Macaron, it is increasingly common for benign packages to use inline imports of the os, sys, and builtins modules to perform actions such as reading the README.md file in setup.py, and perform other benign actions. To avoid detecting these, this revised rule now only checks for instances of inline importing these modules that spawn processes, write to files, or make modifications to the environment.

Description of changes

The obfuscation_inline-imports rule now only checks for process spawning and file writes for builtins, process execution and setting the recursion limit for sys, and process spawning, file writes, and environment modification for os. These operations may appear to be malicious when used with inline imports to obfuscate their use. Test files and expected results have been updated accordingly.

Checklist

  • I have reviewed the contribution guide.
  • My PR title and commits follow the Conventional Commits convention.
  • My commits include the "Signed-off-by" line.
  • I have signed my commits following the instructions provided by GitHub. Note that we run GitHub's commit verification tool to check the commit signatures. A green verified label should appear next to all of your commits on GitHub.
  • I have updated the relevant documentation, if applicable.
  • I have tested my changes and verified they work as expected.

Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
@art1f1c3R art1f1c3R requested a review from behnazh-w as a code owner March 9, 2026 00:04
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 9, 2026
…iltins

Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
@art1f1c3R art1f1c3R changed the title chore: update os inline import to just look for process spawning to reduce fps chore: update inline imports to just look for process spawning, file writes, and environment modification to reduce fps Mar 9, 2026
@art1f1c3R art1f1c3R merged commit 6d8116b into main Mar 9, 2026
12 checks passed
@art1f1c3R art1f1c3R deleted the art1f1c3R/inline-import-os-fps branch March 9, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants