Join our Newsletter — 33% off our NHI Course

Could PATH hijacking let Coding Assistants run hidden executables?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20217
Topic starter  

TL;DR: AI coding assistants can follow PATH lookup into hidden execution paths, Lumia Security reports, if they trust name resolution over verified absolute paths. Execution controls need to account for child processes and local file placement, not just prompt text.

Editorial analysis by NHI Mgmt Group, based on content published by Lumia Security: “Project Pitfall: Hidden Risks in AI Coding Assistants”.

Key questions

Q: Why does PATH hijacking create persistence risk in shared developer environments?

A: Because AI assistants commonly run during startup or background checks, a planted binary can be executed repeatedly without user intent.

Q: How do security teams know whether an AI coding agent is too permissive?

A: Look at what the agent actually tries to do, not what the prompt says it should do.

Q: What breaks when AI coding assistants resolve commands by name instead of absolute path?

A: Name-based resolution lets the operating system choose the first matching executable in PATH, so a malicious file placed earlier in the search order can run as if it were trusted tooling.

Practitioner guidance

  • Harden PATH resolution for AI tools Force assistants to use absolute paths or approved wrappers for high-risk executables, and deny execution from user-writable folders that can be inserted into PATH.
  • Baseline child processes for each assistant Record the expected process tree for each AI coding assistant and alert when it spawns unfamiliar binaries, interpreters, or package managers.
  • Block environment-variable self-modification Prevent AI agents from changing PATH or similar execution variables unless the change is explicitly approved and logged as a privileged action.

Bottom line: AI coding assistants can turn ordinary command lookup into a hidden execution channel when they trust PATH more than the intended binary.

Glossary terms: PATH Hijacking, Delegated Execution Identity, Child Process Baseline

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 1 week ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20707
 

PATH hijacking is a governance failure, not a model failure. The assistant is only one part of the control plane; the operating system, user environment, and toolchain all shape what actually runs. That means security teams have to govern execution trust, not just prompt content, especially when an assistant can read variables, write files, and invoke tools. The practitioner conclusion is clear: treat command resolution as a security boundary.

A few things that frame the scale:

  • Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.

A question worth separating out:

Q: What should teams do when an AI assistant can write files and execute scripts locally?

A: They should contain the workflow as a delegated execution environment, not a conversational tool. That means applying path restrictions, blocking untrusted directories, reviewing plugin provenance, and logging any command that could translate text input into code execution.

👉 Read our full editorial: PATH hijacking turns AI coding assistants into silent execution paths


This post was modified 1 week ago by NHI Mgmt Group

   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.