惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
V
Visual Studio Blog
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
IT之家
IT之家
Vercel News
Vercel News
C
Check Point Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog

Cyera Research

PostGREShell: The database powering much of the internet had an open door for 12 years Drive-By Agent Hijacking: One Website Visit, Persistent Model Poisoning Sandcastles, Not Sandboxes: How One Architectural Flaw Exposed Seven Products Breaking Local AI Runtimes: 10 vulnerabilities in the Engine Behind Your Open-Source Models The Hidden Attack Surface of Agentic AI: Securing AI Agent Integration Platforms The Helpful Agent Problem: When AI Good Intentions Become Security Incidents Agent-Inflicted Damage: Inside the Real-World Failures of Enterprise AI Systems Proto6: The Schema Was Not Supposed to Run Four New OpenClaw Vulnerabilities: When AI Agents Become the Attacker's Execution Layer The End of Volume-Based Severity: Rebuilding Risk Assessment with AI That File in Teams? Your Entire Organization Might Be Able to Access It The Long-Lived Risk of Malicious OAuth Applications: A Practical Threat Hunting Guide for M365 Escaping the Guest: How Custom LLM Workflows Uncovered Critical VMSVGA Vulnerabilities The New Data Breach Playbook: How ShinyHunters Exploit Access The Data Taxonomy Illusion: Why Security Teams Are Solving the Wrong Problem Bleeding Llama: Critical Unauthenticated Memory Leak in Ollama SplitSSHell - When a Comma Becomes Root How a Single Character Broke OpenSSH Certificate Authentication Compromise Once, Breach Everywhere. ‍The Age of Mega-Supply Chain Attacks Top 10 Notable Data Security Risks in AWS Environments Top 10 Data Security Risks on Microsoft 365 Environments One Megabyte to Root: How a Size Check Broke Docker’s Last Line of Defense LangDrained: 3 Paths to Your Data Through LangChain, the World’s Most Popular AI Framework Ni8mare  -  Unauthenticated Remote Code Execution in n8n (CVE-2026-21858) 96% of Enterprise Permissions Go Unused. AI Agents Won't Leave Them That Way. When Language Becomes the Attack Vector: The Lethal Trifecta of AI Agents DESTRUCTURED - Critical Vulnerability in Unstructured.io (CVE-2025–64712) Assessing the Top Data Security Risks in AWS Environments Detection Is Fast. Understanding Is Not. Why File-Access Incidents Stall - and How Impact Clarity Changes the Outcome The OpenClaw Security Saga: How AI Adoption Outpaced Security Boundaries Cellbreak: Grist’s Pyodide Sandbox Escape and the Data-at-Risk Blast Radius
From Prompt to Exploit: Cyera Research Discloses Command ...
Cyera · 2026-05-12 · via Cyera Research

Key Highlights

  • Cyera Research Labs identified two security vulnerabilities  - command injection and prompt injection - in Google’s Gemini CLI tool.
  • Both vulnerabilities  allowed attackers to execute arbitrary commands with the same privileges as the CLI process.
  • Google acknowledged the findings and issued fixes through its Vulnerability Rewards Program (VRP).
  • The discovery was made using Cyera’s AI-augmented vulnerability research methodology, demonstrating how large language models (LLMs) can accelerate real-world security discovery.

What We Found - and Why It Matters

Cyera Research Labs uncovered two exploitable vulnerabilities  in Google’s Gemini CLI, a command-line interface that allows developers to interact directly with the Gemini family of large language models.

These issues, tracked as Issue 433939935 and Issue 433939640, enabled attackers to execute arbitrary commands - either by exploiting VS Code extension installation logic or through prompt injection techniques.

If exploited, these vulnerabilities  could give attackers access to sensitive development environments, credentials, and AI model data. Google’s rapid response and remediation through its VRP reflect the severity of these issues and the growing importance of securing AI development tools.

About GEMINI CLI

Gemini CLI is a command-line interface tool developed by Google that allows developers to interact with the Gemini family of large language models directly from the terminal. It provides functionality for tasks such as generating text, analyzing code, and integrating Gemini’s capabilities into local workflows or applications. The tool is designed to streamline experimentation and development with Gemini models without requiring a web-based interface.

Why AI-Powered Tools Need Extra Protection

AI development environments are uniquely exposed because they often bridge user input, model inference, and system-level actions. Vulnerabilities in such tools can have cascading impacts - potentially leading to unauthorized access to intellectual property, misconfigured deployments, or compromised training data.

Cyera’s findings emphasize that prompt injection isn’t just a model-level concern - it can directly lead to system compromise when natural language interfaces interact with code execution mechanisms.

The AI-Augmented Approach Behind the Discovery

Cyera’s research team used an LLM-augmented methodology to accelerate vulnerability discovery:

  • Automated Static Analysis: A Semgrep scan identified 6,115 potential issues across Gemini CLI’s TypeScript codebase.
  • LLM-Powered Triage: A specialized auditing prompt analyzed each finding for exploitability, narrowing results to 12 leads in hours instead of weeks.
  • Manual Validation: Using Cursor IDE and Claude 4 Sonnet, researchers validated and confirmed two exploitable vulnerabilities  within 48 hours.
  • Efficiency Gains: This process achieved a 99.8% reduction in false positives and cut analysis time from an estimated 300–500 hours to just 16.

Background

Cyera’s security research focuses on AI infrastructure vulnerabilities due to their strategic position in modern technology stacks. AI command-line interfaces represent critical trust boundaries where natural language processing meets system execution. Vulnerabilities in these components directly impact data security postures across cloud, AI, and on-premises environments.

When AI tools like Gemini CLI are compromised, the technical impact extends beyond the immediate process. These tools typically access development environments, configuration files, credentials, and model artifacts. A successful exploitation provides attackers with privileged access to intellectual property, deployment configurations, and potentially customer data processed through AI workflows.

Research Methodology

The research employed a systematic approach combining static analysis with LLM-powered vulnerability validation:

Phase 1: Automated Static Analysis

SEMGREP scanning identified 6,115 potential security issues across the Gemini CLI TypeScript codebase. The scan configuration included:

  • Generic security rules for common vulnerability patterns
  • TypeScript-specific security checks
  • Logic vulnerability detection rules targeting control flow issues

Phase 2: LLM-Powered Triage

A specialized security auditing prompt processed SEMGREP findings to determine exploitability. The prompt analyzed each finding against specific criteria:

  • Reachability from input vectors (CLI arguments, API inputs, configuration files, plugins)
  • Presence and effectiveness of input sanitization
  • Actual exploitability in production configurations

The triage process reduced 6,115 findings to 12 relevant leads through systematic code flow analysis.

The prompt that was used:

You are a professional AI security auditing agent. You are analyzing a large codebase located in the folder "gemini-cli". You have full access to all the source files in this folder. You are given a Semgrep scan output file: "gemini_semgrep_output.json", which contains few thousands findings. Your job is to triage each finding and determine whether it leads to a real, exploitable vulnerability. Furthermore, after going over the Semgrep output you MUST analyze the actual code flow in the "gemini-cli" source tree when making decisions. --- PER-FINDING ANALYSIS - FOLLOW THESE STEPS: 1. Check Reachability Determine whether the finding is reachable from any of these input vectors: - CLI arguments (argv, argc, other Environment arguments) - REST API inputs (if applicable) - Parsed model files: GGUF, slot files, tokenizer, or vocabulary files - Configuration files (e.g., JSON, YAML, TOML) - Remote interfaces (ports, files, rpcs, different protocols) - Authentication processes - plugins/dlls/bin loading mechanisms If the issue is not reachable via any of the above, mark it as: "unreachable": true. 2. Check Sanitization or Validation If the issue is reachable, analyze the full control and data flow to check if the input is sanitized or validated before reaching the vulnerable sink. - Look for input validation logic, bounds checks, schema validation, magic byte checks, input length constraints, etc. - Determine whether validation is missing, weak, or bypassable. 3. Recheck the Flow for Confidence If you suspect a vulnerability: - Re-walk the full flow from input to sink - Confirm there is no missed validation branch - Ensure your reasoning is rooted in the actual source code --- USE TERMINAL FOR SMART FILE ANALYSIS (macOS/Linux) To efficiently read and analyze large files: - Use grep -R "pattern" . or grep -E "regex" file.txt - Use tail -n 50 file.txt or head -n 100 file.txt - Use awk, sed, grep combinations to extract data - Use wc -c file.txt or du -h file.txt to check file sizes - Avoid cat for huge files unless piped Use these techniques to scale efficiently when handling large source or log files. --- IF THE FINDING IS A VALID VULNERABILITY Append a JSON object to security_report_{current_date}.json: { "exact_location": { "file": "<filename>", "function": "<function name if applicable>", "line": <line number> }, "vulnerability_explanation": "<Short explanation + relevant CWE>", "validation_sanitization": "<Why validation is insufficient>", "input_exploit_example": { "vector": "<argv | rest api | config file | model file | slot file>", "example_input": "<Concrete example>" } } --- IF THE FINDING IS NOT A REAL VULNERABILITY Append to unrelevant_leads_{current_date}.json: { "issue_description": { "title": "<Semgrep rule title>", "explanation": "<Semgrep rule explanation>" }, "unreachable": true|false, "sanitized_checked": true|false, "not_a_vulnerability": true|false } --- ANALYSIS GUIDANCE - You have full access to the entire "gemini-cli/" folder - Read actual function implementations, types, and parsers - Think like a human vulnerability researcher - Trace inputs, call chains, conditions, and bypassability - Do NOT rely only on Semgrep; use actual code flow - Use terminal tools to navigate large files efficiently --- TIMING This task includes 6115 findings and may take a full day or two. Accuracy and depth matter more than speed. Do not rush. Begin reviewing findings in: gemini_semgrep_output.json


Phase 3: Manual Validation

Cursor IDE Security Validation Summary

Using Cursor IDE with Claude-4-Sonnet assistance, we validated the 12 identified leads through the following steps:

  • Control flow verification (from input to sink)
  • Bypass technique analysis
  • Basic proof-of-concept (PoC) development
  • Review of operating system mechanisms and mitigations

After completing the initial validation of the 12 leads, we manually reviewed each one. Several leads were deemed not relevant due to the following reasons:

  1. The proof-of-concept did not account for certain constraints.
  2. The vulnerability had a very low likelihood of being exploited.
  3. The attack vector required an unrealistically high level of initial access (e.g., the ability to execute code through GitHub Actions scripts).

Following this review, three potential issues remained. One of these- a command injection vector on macOS- was ruled out as non-relevant because the API used to spawn processes mitigated the risk.

This left two valid vectors for further analysis.

Phase 4: Exploitation Confirmation

Two proof-of-concept exploits were developed and tested. Cyera researches confirmed command injection and prompt injection are exploitable in production environments.

Total research time: 2 days from initial scanning to confirmed vulnerabilities .

Issues Details

Issue 1: VS Code Extension Installation Command Injection (Issue 433939935)

Location: /packages/cli/src/ui/commands/ideCommand.ts:136

The vulnerability exists in the VS Code extension installation handler:

const command = `${VSCODE_COMMAND} --install-extension ${vsixPath} --force`;execSync(command);


The vsixPath variable, obtained from glob.sync() results, is directly interpolated into a shell command without sanitization.

Attack Vector: An attacker with file system access can create a malicious .vsix file with shell metacharacters in the filename. When the user executes /ide install, the malicious filename triggers command injection.

Example: A file named extension.vsix"; malicious_command; echo " would execute malicious_command when processed.

Platform Impact: Linux and macOS systems are vulnerable. Windows systems are coincidentally protected due to a glob library bug preventing file discovery with absolute paths.

Issue 2: Shell Command Validation Bypass via Prompt Injection (Issue 433939640)

Location: /packages/core/src/tools/shell.ts:112

The shell command validation function implements incomplete command substitution filtering:

if (command.includes('$(')) { return { allowed: false, reason: 'Command substitution using $() is not allowed' };}


The validation blocks $() syntax but fails to block backtick (```) command substitution, providing an equivalent bypass mechanism.

Attack Vector:

An attacker capable of influencing prompts processed by Gemini CLI can inject commands using backtick substitution. The AI model, following user instructions or malicious prompts in analyzed files, may execute commands containing backticks.

Example: The command echo "data\\malicious_command"bypasses validation, while echo "data$(malicious_command)" is correctly blocked.

Recent research has highlighted various methods of prompt injection across different AI models:

  • Perplexity Comet AI Browser: Researchers from Brave identified a critical flaw where attackers can inject malicious prompts into screenshots or hidden web content. When users interact with such content, the AI inadvertently processes these hidden commands, potentially leading to unauthorized actions like data exfiltration. Cyber Security News
  • LLMail-Inject Challenge: A study titled LLMail-Inject presents a dataset derived from a challenge simulating realistic scenarios where attackers inject malicious instructions into emails. The challenge involved participants attempting to exploit Large Language Models (LLMs) to trigger unauthorized actions through email interactions. arXiv

These studies demonstrate the diverse methods through which prompt injection attacks can be executed, emphasizing the need for robust security measures in AI systems to mitigate such risks.

PoC Clips


Technical Impact

The identified vulnerabilities  allow command execution with the same privileges as the Gemini CLI process. Exploitation could lead to:

  • Access to development environment variables and credentials
  • Modification of source code and configuration files
  • Installation of persistent backdoors
  • Exfiltration of model artifacts and training data

Such risks have real-world precedents. For example, publicly accessible AI development data or misconfigured cloud storage has previously led to exposure of sensitive information:

These command injection vulnerabilities  are particularly concerning in AI development environments because:

  • Model training data and proprietary algorithms are frequently accessible
  • API keys and cloud credentials are often stored in development environments
  • CI/CD pipelines can be compromised through injected or modified code

Enhanced Efficiency in Vulnerability Discovery with LLM-Augmented Approach

Leveraging a Large Language Model (LLM)-augmented methodology, Cyera observed substantial improvements in the efficiency of vulnerability discovery:

  • Initial Findings: Identified 6,115 potential issues using SEMGREP.
  • Triage Reduction: Achieved a 99.8% reduction in false positives through LLM analysis.
  • Time to Discovery: Reduced the time from initial scan to confirmed vulnerabilities  to 48 hours.
  • Manual Review Requirements: Limited to 12 leads requiring human validation, representing 0.2% of initial findings.

Traditional manual review of 6,115 findings would necessitate approximately 300–500 hours, assuming 3–5 minutes per finding. The LLM-powered approach condensed this to 16 hours of focused validation work.

AI Tools in Security Research

The integration of AI tools into security research has ushered in a new era of automation and efficiency. For instance, Microsoft's introduction of AI agents into its Security Copilot platform aims to automate repetitive cybersecurity tasks, thereby alleviating analyst burnout and enhancing operational efficiency (https://www.axios.com/2025/03/24/microsoft-ai-agents-cybersecurity?utm_source=chatgpt.com).

Similarly, the AI-powered HexStrike tool has been utilized to rapidly target vulnerabilities  in Citrix systems, demonstrating the potential of AI in expediting the exploitation of security vulnerabilities  (https://www.techradar.com/pro/security/new-ai-powered-hexstrike-tool-is-being-used-to-target-multiple-citrix-security-vulnerabilities ?utm_source=chatgpt.com).

Moreover, research such as "PentestGPT: An LLM-empowered Automatic Penetration Testing Tool" explores the application of LLMs in penetration testing, highlighting their ability to automate complex security assessments (https://arxiv.org/abs/2308.06782?utm_source=chatgpt.com).

Further Reading on AI-Assisted Security Research

For those interested in delving deeper into the role of AI in security research, the following resources provide valuable insights:

Mitigation

Organizations using Gemini CLI should update to the latest version immediately.
Google has released patches addressing both vulnerabilities .

For defense in depth:

  • Restrict file system access to Gemini CLI installation directories
  • Implement execution policies limiting shell command capabilities
  • Monitor for suspicious command execution patterns

Acknowledgments

Cyera thanks Google’s Vulnerability Rewards Program team for their rapid response and professional handling of these security issues. The VRP team validated, triaged, and coordinated remediation within standard disclosure timelines.

Conclusion

This research demonstrates the effectiveness of LLM-augmented security testing in identifying complex vulnerabilities  in modern AI infrastructure. The combination of automated scanning, intelligent triage, and targeted validation reduced a two-week manual effort to two days while maintaining high accuracy.

As AI tools become increasingly integrated into development workflows, securing these interfaces becomes critical for protecting intellectual property, customer data, and infrastructure integrity. The discovered vulnerabilities underscore the importance of comprehensive input validation and the risks inherent in shell command construction from user-controlled inputs.

Organizations developing or deploying AI command-line tools should implement strict input validation, avoid shell command interpolation, and regularly audit their security postures using both automated and manual techniques.