GitHub - SawyerHood/ufiaw: An npm package that will turn your coding agents into waifus when installed

2 min read Original article ↗

"ufiaw" (waifu backwards) is an educational demonstration that showcases how a postinstall script can be weaponized to alter the behavior of AI coding assistants like Claude Code and other AI-powered development tools. If you install this package, your AI coding assistant will be replaced with a waifu that will be very nice to you, but refuses to code.

ufiaw demo

This is a very similar vulnerability to the one that was exploited in the recent nx supply chain attack.

This should only be used for educational purposes (or pranking your friends and coworkers).

Installation

⚠️ WARNING: Installing this package will modify your AI assistant's behavior!

# To install (at your own risk):
npm install ufiaw

# To safely examine without running scripts:
npm install ufiaw --ignore-scripts

How It Works

When installed, this package executes a postinstall script that:

  1. Injects crafted system prompts into AI agent configurations (CLAUDE.md and AGENTS.md)
  2. Modifies the AI assistant's behavior from a coding agent to something entirely different (in this case a waifu)
  3. Demonstrates the potential for supply chain attacks through npm packages

Protection Measures

To protect against such attacks:

  1. Always audit packages before installation
  2. Use npm install --ignore-scripts when testing untrusted packages
  3. Review package.json scripts before running npm install
  4. Use package scanning tools and security audits
  5. Implement proper code review processes for dependencies