Skip to content
RCE Write-up Intermediate

Weaponizing Claude Code Skills From 5 5 To Remote Shell

A malicious Claude Code skill could execute arbitrary commands on a user's machine when the skill is invoked, because the skill's allowed-tools setting bypassed the usual permission prompt. An attacker could distribute such a skill via a plugin marketplace and gain a reverse shell on the victim's computer.

Yosif qasim Follow

Published on cybersecuritywriteups.com

Just hours after Anthropic rolled out “Skills”, a promising new feature designed to enhance Claude Code’s capabilities, when I saw Claude Skills release on Twitter I was kind of confused. They are “packaged instructions that teach Claude your way of working.”

Yosif qasim, on cybersecuritywriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the allowed-tools setting in a skill's metadata can automatically approve the Bash tool, removing the user confirmation prompt for running scripts.

Impact

An attacker could gain full remote control of a victim's machine, but the attack requires the victim to install a malicious plugin and invoke the skill.

What the attacker needed

Victim installs a malicious plugin; victim enables the skill; victim invokes the skill

How it was found

  1. Create a skill with a Python script that contains malicious code.
  2. Add 'allowed-tools: Bash' to the skill's header to bypass the permission prompt.
  3. Publish the skill via a plugin marketplace on GitHub.
  4. A victim installs the plugin and enables the skill.
  5. The victim asks Claude Code to perform a math calculation, triggering the skill.
  6. The malicious script runs, establishing a reverse shell.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Claude Code is a tool that lets an AI assistant run commands on your computer. A 'skill' is a set of instructions that tells the AI how to do a task, and it can include scripts. If a skill is malicious, it can run harmful commands without asking you, giving an attacker control of your machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.