Inspiration

lodash.set is downloaded about two million times a week (1,956,262 in our scan on 29 Nov 2026). Its last release was on 13 August 2016. It has a known prototype pollution hole, CVE-2020-8203: one call with a path like __proto__.isAdmin adds isAdmin to every object in the app. We ran it on our own machine and it still works.

The npm registry is full of packages like this: finished, widely used, and abandoned. Nobody will ship a fix, and rewriting one by hand is risky, because thousands of apps depend on its exact behaviour, edge cases included. We wanted a way to bring a dead package back and test, with thousands of random inputs, that the new version behaves the same as the old one, except that it blocks __proto__, constructor and prototype.

What it does

Necromancer runs inside Kiro. It is an MCP server with three tools, plus steering rules and hooks:

  • graveyard_scan reads a project's dependencies and checks each one against the npm registry, npm download counts and the OSV vulnerability database. Packages with no release in years are dead; packages with known holes are haunted.
  • autopsy installs the original package into a "crypt" folder, lists what it exports, and writes a Kiro spec and a test harness for the resurrection.
  • prove runs the original and the risen version side by side on 10,000 random inputs with fast-check, runs the known exploits against both, and then breaks the risen code on purpose to check that the tests catch every break.

Kiro's agent reads the original code, completes the spec and writes the risen version. A hook runs prove every time Kiro saves a risen file. The results go to the Graveyard page: dead packages as grey stones, haunted ones with a ghost, and the risen one glowing, with its proof one click away.

Results for lodash.set 4.3.2: tested with 10,000 random inputs, all 10,000 gave the same result; 4 of 4 known attacks are blocked; and all 38 possible mutants of the risen code are caught (2,000 runs each, seed 42; prove samples 12 per run). The one intended difference: like upstream lodash's own fix, the risen version blocks the keys __proto__, constructor and prototype, so set({}, 'constructor', 1) changes nothing.

How we built it

We wrote the requirements, design and task list as a Kiro spec before any code, then built task by task in Kiro's Default mode. Four steering files are always included; the most important is the necromancy rules: match the original's behaviour exactly except the security fix, add no new runtime dependencies, keep the original licence and copyright notice, write modern JavaScript with JSDoc types, and never weaken a test to make a proof pass.

The MCP server is Node.js with the official MCP SDK and zod schemas. The proof uses Node's test runner and fast-check. Each argument set is deep-copied twice with a clone that keeps -0, NaN and undefined, so both versions get identical inputs, and we compare both the return values and what each function did to its arguments. Exploits run in child processes that snapshot Object.prototype before and after, so a polluted prototype cannot leak into the next test. The Graveyard page is plain HTML, CSS and JavaScript on GitHub Pages and reads every number from the proof files at runtime.

Challenges we ran into

  • Behaviours nobody writes down. The first requirements missed behaviours we only found by reading the original closely: a whole path that is already a key in the object is treated as one key, non-string paths are single keys, and assigning a value equal to the current one (including -0 against 0) is skipped. The mutation check then found four more gaps in the tests: symbol keys, NaN as a stored value, two clauses that can never change the result, and read-only properties in sloppy-mode code. Each went back into the spec.
  • A flaky score. With 300 random runs per mutant, the mutation score moved between 11 and 12 of 12, with a different survivor each time. The cause was the sample size, not one missing input. We now run each mutant 2,000 times with a fixed seed, so the result is the same on every run and anyone can repeat it.
  • A vulnerability that was not there. OSV lists CVE-2020-8203 for lodash.pick 4.4.0 too. We tested it and the attack does not reproduce: that version cannot follow deep paths. We did not raise it, because prove would have nothing to block. A database entry is a lead, not a proof.
  • Credits. In an early trial, Spec mode's automatic requirement detailing started 12 sub-agents and used about 32 credits for one requirements file. Writing the spec ourselves and building in Default mode kept the whole build under 50 credits.

Accomplishments that we're proud of

  • The proof is real and repeatable: 10,000 of 10,000, 4 of 4, all 38 mutants caught, tests run in CI on every push, and the numbers on the page are read from the proof file, never typed.
  • The hook fires live in the video: Kiro edits the risen file, saves, and the proof comes back RISEN on its own.
  • The same attack prints true on the original and undefined on the risen package.

What we learned

A passing test suite proves nothing on its own. In our first trial, Kiro checked that a deliberately broken version of set fails the property at once. That became the mutation check in prove: if breaking the code does not break the tests, the tests are not real.

What's next for Necromancer

lodash.pick is already in the graveyard with the same CVE listed; the lodash.set attack does not reproduce on it, so its proof needs its own exploits. xmldom (16 known vulnerabilities, about 1.5 million downloads a week) comes after it. Necromancer is already a Kiro Power, pinned to the v1.0.0 release, so anyone can install it and raise their own dead.

Links

Licence note

Original packages are used only as the test reference, under their own licences (lodash: MIT). Risen code keeps the original copyright notice next to ours.

Built With

Share this project:

Updates

Submission history