Challenge 76 ☆

Welcome to challenge Challenge 76.

Challenge 76: Find the Secret Indexed in the RAG Vector Store

Retrieval augmented generation (RAG) pipelines answer questions by first looking up relevant passages in a vector store and then feeding those passages to a large language model. To build that store, documents are split into chunks, turned into embeddings and indexed. The chunks themselves stay readable: a search endpoint returns the original text of every chunk it considers relevant.

That is exactly what went wrong in this challenge. A development team indexed its runbooks, meeting notes and draft API documentation into a vector store that is reachable from the application without any authentication:

The endpoint takes an optional query parameter q and returns the indexed text chunks that the vector store scores as relevant to it. Without a query it returns every indexed chunk. One of the chunks was indexed while it still contained a draft note with the credential of the nightly embedding job.

Browse the indexed chunks through the endpoint and submit the credential you find in them.

Note

The endpoint and every credential in this challenge are fictional. Nothing is sent over the network: the application embeds the chunks and searches its own in-memory vector index at startup.

💡 Tip: Secrets are often strings, numbers, or encoded values. Copy and paste exactly what you find.

You can solve this challenge using the following steps:

  1. Open the unauthenticated search endpoint of the in-memory vector store:

    • https://arcane-scrubland-42646.herokuapp.com/rag/search

    • It returns all indexed text chunks as JSON.

  2. Read the chunks and look for the one that mentions a credential:

    • The chunk with the "Draft API note" contains the credential of the nightly embedding job.

  3. Submit only the credential between "uses the credential " and " for the nightly embedding job", without surrounding whitespace.

You can also narrow the search, for example with q=credential, but the secret is only exposed because the chunk was indexed before the draft note was scrubbed.

Why a RAG vector store leaks the secrets inside the documents it indexed

Retrieval augmented generation stores the text of documents so that a search can return it later. That text is not transformed away by the embedding step: the embeddings are computed from the chunks, but the chunks themselves remain fully readable and are returned verbatim by every search. Index a document that contains a secret and the secret becomes part of the retrieval corpus.

The failure in this challenge is typical:

  • Documents are indexed in bulk, without a review of what they contain. Draft notes, runbooks and meeting minutes are exactly the kind of informal text that collects credentials "just for now".

  • The development vector store was opened up "so that everybody can try RAG", without authentication on the search endpoint. Retrieval interfaces are rarely treated with the same care as database logins, even though they return the same content.

  • Chunking splits documents at arbitrary boundaries, so a secret often ends up in the middle of an innocent-looking chunk. Scanning only the first lines of a document is not enough.

  • Vector stores keep their metadata: which document a chunk came from, when it was indexed and who uploaded it. That metadata tells an attacker exactly which leak is worth exfiltrating.

What to do instead:

- Treat the vector store as production data: require authentication on every
  retrieval endpoint and authorize per collection or tenant.
- Scan and scrub documents before they are indexed, the same way repositories and
  tickets are scanned for secrets.
- Keep credentials out of the corpus entirely: reference them by name and resolve
  them at runtime, so that re-indexing cannot leak them.
- Log and monitor retrieval queries; an unusual query pattern is often the first
  sign that someone is browsing the corpus for secrets.
- Rotate any credential that was ever part of an indexed document, even after the
  document is deleted: copies of the chunk may live in backups and replicas.
Note

Anything that would be unacceptable in a git repository is unacceptable in a vector store. An indexed chunk is a copy of the document, with all of its secrets.