Skip to content

[sec-check] Avoid shell injection when resolving partition devices #55

Description

@frostyard-hive

Security Finding

Severity: medium
Type: unsafe-pattern

Diskutils.separate_device_and_partn concatenates a device path into an lsblk shell command and invokes it with shell=True (bootc_installer/core/disks.py:22-25). The current caller accepts any dictionary key beginning with /dev/, so a crafted key containing shell metacharacters reaches the shell unchanged.

Impact

An attacker who can influence installer step state or a device identifier can execute arbitrary commands in the installer GUI context. Even where current UI-generated values are trusted, the helper is a reusable command-injection sink.

Recommendation

Invoke subprocess.check_output with an argv list and no shell, validate that the path is an expected /dev/... device, and add a regression test proving shell metacharacters remain a single argument.


Filed by sec-check agent (ACMM L4/L5 — hold-gated mode)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions