> ## Content Index
> Fetch the complete content index at: https://greyhatguy007.win/llms.txt
> Use this file to discover other available public pages before exploring further.

# The night my vulnerability scanner became the vulnerability
- URL: https://greyhatguy007.win/the-night-my-vulnerability-scanner-became-the-vulnerability/
- Published: 2026-11-21T13:28:32.000Z
- Updated: 2026-11-23T18:26:54.000Z
- Description: Our vulnerability scanner spent March stealing credentials instead of finding CVEs. Mine wasn't even the pipeline that got hit. Yours probably runs latest too.
- Author: Ritvik Prasad
- Tags: DevSecOps, Incident-Response, CVE

A colleague once joked that the only thing worse than no security scanning is security scanning you trust too much. In March 2026 I found out he was right. NVD published CVE-2026-33634, a supply chain attack on Trivy, the open source vulnerability scanner that a huge slice of the industry, including us, runs inside CI. A threat actor had published a malicious release and pushed credential-stealing malware into the action and setup repositories. The reference, for anyone who wants the details, is on the [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2026-33634?ref=greyhatguy007.win).

I came across it close to midnight, scrolling through the RSS feeds and tech news I flip through when I can't sleep. My first reaction was not panic, it was arithmetic. We had scheduled Trivy scans in our GitLab CI pipelines. Some of them pulled the scanner image with the `latest` tag. The malicious versions had circulated under tagged releases, and `latest` was among the poisoned references. If one of our scheduled jobs had pulled a compromised image during the exposure window, the malware did not scan our containers. It scanned our pipeline environment for credentials.

That was the thought that kept me up: our scanner had been sitting inside the one place where we keep every secret, holding a list of everything worth stealing.

## Context: what was actually at stake

We run a product with dozens of microservices across web, mobile and firmware, on a mix of hosted and self-hosted runners. The CI environment of any given job is not just that job's variables. Group-level CI variables get inherited downward, so a scanning job can see tokens and credentials that belong to entirely unrelated projects. Some of our pipelines carried kubeconfigs for our dev, QA, staging and production clusters, service accounts for pulling images from our artifact registry, code signing keys, and the usual pile of S3 tokens and service account JSON files that accumulate in a mature CI setup.

The next morning, before anything else, I pinned our scanner image to a known safe version. That was the obvious first move and it took minutes. The hard part was the question underneath it: which of our jobs had already run a compromised image?

## What I tried

My first attempt was the obvious one. I used the GitLab API to pull every pipeline that ran in a window of a few days around the disclosure. That gave me a pile of data so large it was useless. Pipelines were firing constantly, most of them had nothing to do with the scanner, and I had no way to point at anything.

So I flipped the direction of the search. Instead of asking "which pipelines ran during the exposure window", I asked "which pipelines referenced the compromised image". The CVE disclosure included the digests of the malicious images. I wrote a script against the GitLab API to scan pipeline job records for the image references and match them against those digests. Within a short time I had the exact jobs, on the exact commits, that had executed a compromised image.

The difference between the two approaches is worth dwelling on. Time-based scoping gives you noise proportional to your CI volume. Artifact-based scoping, matching known malicious digests, gives you a finite, provable list. Everything after that depended on having that list.

With the affected jobs identified, I mapped what each one could actually see: its project's CI variables, the inherited group variables, any credentials in the working tree at the commits that ran, and the kubeconfigs in scope. Then the rotations began, in an order driven by reachability. Kubeconfigs ranked lower than you might expect, because they only mattered from inside our cloud organization or network. The externally reachable credentials, the S3 tokens and service account keys, went first.

## The decision and the trade-off

The uncomfortable question was git history. Should we rewrite it to scrub anything sensitive that had ever landed in the repos?

We run a hybrid branch and trunk based release process where each release line lives as a branch. Rewriting history would have erased the traceability that process depends on. Cherry-picking a fix onto a release branch after a history rewrite becomes archaeology. And rotating the exposed credentials solves the actual problem anyway. A secret in git history that has been revoked is just an old string. We chose revoke and rotate over rewrite, and I still think that was right.

One rotation, though, stalled in a way no runbook anticipates. The owner of one of the exposed credentials was unreachable for weeks. He had been traveling when flash floods hit the region he was in, and contact simply went dark. Rotating that credential required proving our identity to the vendor and walking their recovery process without the person who normally owns it. That single credential outlasted every other piece of the remediation by weeks, and there was no technical trick that could hurry it. Incidents are not only made of systems. They are made of people, and people sometimes cannot be reached.

## Outcome

Everything that could be rotated was rotated, the affected kubeconfigs were revoked along with their service accounts, roles and bindings, and we confirmed none of the compromised credentials could reach the clusters anymore. The scheduled scanner stage was disabled and its function moved to a different security platform. Trivy itself stayed in the pipeline, pinned to a safe version, because the scanner was never the problem. Trusting a mutable tag was.

There is one part of the timeline I keep thinking about. I fixed my own pipelines the morning after disclosure and reported it, and for months that felt like done. Then, roughly five months later, word came down internally that vulnerable images had been executed elsewhere too. It turned out that pipelines someone else had set up, ones I had never looked at, had pulled the compromised image as well. They had run only once during the window, which was luck, not control. If I had spent a few more hours on that first day searching the whole group for every use of the poisoned tag instead of only fixing my own, a large chunk of the follow-up work would never have existed.

## Lesson

The lesson is not "pin your images", though you should. It is that an incident's blast radius is defined by trust boundaries nobody drew deliberately. A job inherits group secrets. A scanner runs with the identity of the pipeline. A colleague's pipeline shares your group. When something inside CI turns hostile, the perimeter is everything CI can see, and the first hour should be spent proving where that perimeter ends, not where you personally remember touching it.

And keep the feeds. This whole story, the good outcome of it anyway, started with an RSS item read past midnight.

---

**TL;DR:** A supply chain attack on Trivy turned our scheduled CI scans into a credential-stealing risk across dozens of microservices. Digest-based scoping, risk-ranked rotation, and a lesson about auditing pipelines I didn't write.