Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Parsing Character Card V2/V3 PNG Chunks in Pure Browser JS & Building a Zero-XSS Regex Status Bar Sandbox

Interactive fiction and AI roleplay creators pass around thousands of "character cards" every week—portable PNG portraits that secretly carry structured JSON world lore, persona definitions, alternate opening scenes, Lorebooks, and Regex-driven HTML status bars. Yet the tooling around these files has historically been fragile: legacy scripts rely on Node's Buffer or naive atob() calls that…

Interactive fiction and AI roleplay creators frequently share "character cards" in the form of portable PNG portraits. These cards contain structured JSON world lore, persona definitions, alternate opening scenes, lorebooks, and regex-driven HTML status bars. However, the tools for handling these files have been unstable in the past.

Legacy scripts used Node's Buffer or naive atob() calls, which caused corruption of Japanese, Korean, Thai, and Chinese UTF-8 characters. Community-shared custom HUD templates were often placed directly into innerHTML, turning status bars into potential XSS vulnerabilities. To address these issues, Rubii AI's engineering team developed a browser-based Character Card V1/V2/V3 & Character.AI Export Converter, open-sourcing the engine and Chrome Extension under the MIT license.

They established three non-negotiable constraints: zero dependencies and 100% browser-native execution, zero extension permissions, and zero-XSS regex UI sandboxing. This deep dive explains the binary parsing mechanics for Character Card V2 and V3 PNG chunks, the challenges encountered, the creation of an allowlist-based HTML and inline-CSS sanitizer for regex status bars, and how the same linting/layout tools were exposed through the Model Context Protocol.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Patterns - Messaging, Publisher-subscriber, dynamic routing

Discussion on Messaging pattern Context: Some distributed systems are composed of services that were developed independently.

  • Messaging pattern enables asynchronous data exchange via message bus
  • Publisher-Subscriber pattern allows independent components to disseminate information
  • Dynamic Routing pattern optimizes communication in complex business processes

bigcommerce-api-mcp: Authentication Stopped at the Door but Not on the Transport Routes

bigcommerce-api-mcp: Authentication Stopped at the Door but Not on the Transport Routes An MCP server can expose a small number of routes and still have more than one security boundary.

  • CVE-2026-138034 affected bigcommerce-api-mcp versions prior to 1.0.1
  • /sse and /messages routes bypassed authenticateRequest middleware
  • Upgrade to version 1.0.1 or later to mitigate risk

Go GC Write Barriers Under Concurrent Mutation: Tri-Color Invariants, Barrier Costs, and the Allocation Pressure Trap

The Problem Isn't GC Pauses—It's What Triggers Them Most Go engineers know the GC runs concurrently and that STW pauses are short.

  • Go's concurrent GC uses write barriers to maintain invariants during marking.
  • Hybrid write barrier combines Dijkstra insertion and Yuasa deletion barriers.
  • Write barrier buffer and drain cost increases with sustained high mutation rates.

More from Saturday, 28 November 2026 →