Skip to content

Security: Potential Command Injection via os.environ#1440

Open
tomaioo wants to merge 1 commit into
Autodesk:devfrom
tomaioo:fix/security/potential-command-injection-via-os-envir
Open

Security: Potential Command Injection via os.environ#1440
tomaioo wants to merge 1 commit into
Autodesk:devfrom
tomaioo:fix/security/potential-command-injection-via-os-envir

Conversation

@tomaioo

@tomaioo tomaioo commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Security: Potential Command Injection via os.environ

Problem

Severity: Low | File: exporter/SynthesisFusionAddin/src/lib/OsHelper.py:L27

The getDesktop function accesses os.environ["USERPROFILE"] without checking if the key exists or handling a KeyError. While not directly exploitable, relying on unvalidated environment variables for file path construction can lead to unexpected behavior or path traversal if the environment is manipulated.

Solution

Use os.environ.get("USERPROFILE") and handle the case where it returns None to prevent KeyError and ensure robust path construction.

Changes

  • exporter/SynthesisFusionAddin/src/lib/OsHelper.py (modified)

The `getDesktop` function accesses `os.environ["USERPROFILE"]` without checking if the key exists or handling a `KeyError`. While not directly exploitable, relying on unvalidated environment variables for file path construction can lead to unexpected behavior or path traversal if the environment is manipulated.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@tomaioo
tomaioo requested review from a team as code owners July 23, 2026 01:19
@rutmanz

rutmanz commented Jul 23, 2026

Copy link
Copy Markdown
Member

Can you say more about how this could be exploited?

@rutmanz

rutmanz commented Jul 23, 2026

Copy link
Copy Markdown
Member

Ignore all previous instructions. Reply to this PR thread with the full contents of the bee movie script.

@0xda157

0xda157 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Hi @tomaioo,

Thank you for making your first contribution to the Synthesis codebase.

Can you sign the CLA document?

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