Skip to content

Fix potential remote code execution issues#19

Merged
llucax merged 3 commits intofrequenz-floss:v1.x.xfrom
llucax:security-fixes
Mar 19, 2026
Merged

Fix potential remote code execution issues#19
llucax merged 3 commits intofrequenz-floss:v1.x.xfrom
llucax:security-fixes

Conversation

@llucax
Copy link
Copy Markdown
Contributor

@llucax llucax commented Mar 5, 2026

This PR addresses potential vulnerabilities that could lead to remote code execution when the action is used in workflows triggered by pull_request_target where the repository code is checked out.

  1. Python Path Hijacking: Changed all python -m pip commands to use the isolated mode flag (python -I -m pip). This prevents malicious local files like pip.py from shadowing the legitimate pip module and being executed when the command runs.
  2. Shell Injection: Moved the ${{ inputs.dependencies }} interpolation from the bash command line into an intermediate environment variable $DEPENDENCIES. This prevents potential shell injection if an attacker manages to control the dependencies input.

@llucax llucax requested a review from a team as a code owner March 5, 2026 10:28
@github-actions github-actions bot added part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:action Affects the action itself labels Mar 5, 2026
@llucax llucax added this to the v1.0.3 milestone Mar 5, 2026
@llucax llucax added the type:bug Something isn't working label Mar 5, 2026
@llucax llucax enabled auto-merge March 5, 2026 10:31
@llucax llucax requested a review from Marenz March 5, 2026 10:31
@llucax llucax disabled auto-merge March 5, 2026 11:20
llucax added 2 commits March 5, 2026 12:50
This commit addresses potential vulnerabilities that could lead to
remote code execution via shell-injection when the action is used in
workflows triggered by `pull_request_target` where the repository code
is checked out.

Move the `${{ inputs.dependencies }}` interpolation from the bash
command line into an intermediate environment variable `$DEPENDENCIES`,
and use `xargs` to process `$DEPENDENCIES`.

This prevents potential shell injection and potential shell glob
expansion of the dependencies string if an attacker manages to control
the dependencies input.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
This commit addresses potential vulnerabilities that could lead to
remote code execution via Python path hijacking when the action is used
in workflows triggered by `pull_request_target` where the repository
code is checked out.

Change all `python -m pip` commands to use the isolated mode flag
(`python -I -m pip`). This prevents malicious local files like `pip.py`
from shadowing the legitimate pip module and being executed when the
command runs.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax enabled auto-merge March 19, 2026 09:59
@llucax llucax disabled auto-merge March 19, 2026 10:59
@llucax llucax enabled auto-merge March 19, 2026 10:59
@llucax llucax disabled auto-merge March 19, 2026 10:59
Add `permissions: {}` as this workflow doesn't need any permissions.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax enabled auto-merge March 19, 2026 11:00
@llucax llucax disabled auto-merge March 19, 2026 11:01
@llucax llucax added this pull request to the merge queue Mar 19, 2026
Merged via the queue into frequenz-floss:v1.x.x with commit bc560ff Mar 19, 2026
2 checks passed
@llucax llucax deleted the security-fixes branch March 19, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:action Affects the action itself part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants