# CVE-2013-4660: Deserialization Code Execution in js-yaml

> Remote attackers can execute arbitrary code by sending crafted YAML strings to applications using the vulnerable JS-YAML library.

- **Severity:** Medium 6.8 (`AV:N/AC:M/Au:N/C:P/I:P/A:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Jun 2013
- **Updated:** 17 Sep 2024
- **Also known as:** GHSA-xxvw-45rp-3mj2

## What is CVE-2013-4660?

CVE-2013-4660 is a medium-severity code injection vulnerability in n/a, published on 28 Jun 2013. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, which allows remote attackers to execute arbitrary code via a crafted string that triggers an eval operation.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2013-4660?

2 open source packages ship an affected version, including js-yaml. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `js-yaml` | npm | All versions | 2.0.5 |
| `js-yaml` | npm | All versions | 2.0.5 |

Products: Nodeca Js-Yaml.

## How do I fix CVE-2013-4660?

Upgrade js-yaml to 2.0.5 or later.

## Is CVE-2013-4660 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2013-4660 exists.

Public exploit code:

- Nodejs js-yaml load() Code Execution (metasploit)
- Nodejs - 'js-yaml load()' Code Exec (Metasploit) (exploitdb)

## Other vulnerabilities in n/a

- [CVE-2026-59869](https://insights.sbomify.com/CVE-2026-59869/): js-yaml: YAML merge-key chains can force quadratic CPU consumption (high 7.5)
- [CVE-2026-59870](https://insights.sbomify.com/CVE-2026-59870/): js-yaml quadratic-complexity denial of service via YAML11_SCHEMA !!omap parsing (high 7.5)
- [CVE-2026-59868](https://insights.sbomify.com/CVE-2026-59868/): js-yaml: YAML merge-key chains can force quadratic CPU consumption (medium 5.3)
- [CVE-2026-53550](https://insights.sbomify.com/CVE-2026-53550/): js-yaml: Quadratic-complexity DoS in merge key handling via repeated aliases (medium 5.3)
- [CVE-2025-64718](https://insights.sbomify.com/CVE-2025-64718/): js-yaml has prototype pollution in merge (<<) (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2013-4660 and fix it if it is affected.

What it is: CVE-2013-4660 is a medium-severity code injection vulnerability in n/a, published on 28 Jun 2013. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2013-4660 exists.

Affected packages and fixed versions:
- js-yaml (npm): affected all versions; fixed in 2.0.5
- js-yaml (npm): affected all versions; fixed in 2.0.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2013-4660/ (Markdown: https://insights.sbomify.com/CVE-2013-4660/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2013-4660
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2013-4660
- OSV: https://osv.dev/vulnerability/CVE-2013-4660

---
From sbomify Insights: https://insights.sbomify.com/CVE-2013-4660/
Summaries are generated and may contain mistakes; the official description above is the record.
