Urgent.News

What's breaking now, across thousands of outlets.

Tech

I shipped a redaction library, then found it leaking a private key

I write a small zero-dependency library, llm-stream-guardrails , that strips secrets and PII out of an LLM's output stream before it reaches a screen or a log. Last week it was leaking a private key. This is the bug, how an adversarial pass found it, and the four things it turned up — now fixed in 0.7.9, with a published advisory (GHSA-777v-7mvx-mxgp). I'm writing it up because the interesting…

A zero-dependency library called llm-stream-guardrails was developed to mask secrets and PII from an LLM's output stream. However, it was discovered that the library had a bug, which allowed for the leaking of a private key. The library held a PEM private key within a PEM block, and the mechanism that held the key trusted the footer. If the footer was mislabeled, the key was read as closed and only the header was masked. The body of the key streamed through in cleartext.

The tests for the library were designed to assert that a well-formed key block was masked. However, they did not assert the absence of a leak on a malformed block, as the tests were written for inputs that the developers thought of. This allowed for the bug to go unnoticed.

To fix the bug, the library's tests were changed to stop testing examples and start testing properties adversarially. This meant that for any input, the library would check if a value that the policy should mask ever reached the output. The library was then fuzzed to test roughly 320,000 chunkings, and a leaked body no longer reached the output.

The four issues that led to the leaking of the private key have been fixed in version 0.7.9 of the library. The regression tests now ensure that the streamed-equals-whole invariant holds across these fuzzed chunkings. A public advisory was also published for the issue: GHSA-777v-7mvx-mxgp. The main lesson from this experience is that a passing test only proves that the code does what you asked, but it says nothing about what you did not. For a redactor or any system whose job is to withhold, a missing test can be the whole product.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

YouTube transcripts for RAG: fetch, chunk and embed captions in 30 lines of Python

Disclosure: I built the Apify Actor used in this tutorial. This post was written with AI assistance. A talk, a lecture series or a product channel is a knowledge base that happens to be stored as…

  • Install Python 3.11+, Apify-client, sentence-transformers, and numpy packages
  • Fetch YouTube transcripts via Apify API token, segment into 60-second chunks
  • Embed chunks with SentenceTransformer for semantic search and retrieval

A Hall of Fame of Real Stats

Real figures from the TDK CLI GitHub repository as of October 18, 2026: stars, forks, releases, merged pull requests, open and closed issues, and contributors.

I asked Gemma for Japanese homework. It wrote about eating a friend.

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle What I Built JaExC (Japanese Exercise Creator) is a Ruby gem that writes kanji-reading exercises with a…

  • Gemma, a Japanese exercise creator, generated a writing about eating a friend.
  • The Ruby gem uses an open-weight model for kanji-reading exercises.
  • JaExC tool assists teachers in creating exercises for students with varying kanji knowledge.

Which mule accounts do you freeze? A checked minimum cut on a 4.49-million-transfer FalkorDB graph, and a max-flow bug I hit

After a scam alert lands on a mule account, "is this account bad" is already answered. The useful question comes next: the money is moving, so which few accounts do you freeze so it loses its routes…

  • Chokepoint tool freezes mule accounts to stop money laundering
  • FalkorDB graph had maxFlow algorithm bug affecting 12-17% of networks
  • Issue resolved by adjusting capacities and adding comparison check

More from Sunday 18 October →