Skip to content

fix(rules): leaked-secrets hosted-search key under an admin name is high; Meilisearch master and search keys #1515 - #1524

Closed
nc9 wants to merge 1 commit into
mainfrom
fix/1515-admin-key-tier
Closed

nc9 wants to merge 1 commit into
mainfrom
fix/1515-admin-key-tier

Conversation

@nc9

@nc9 nc9 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Closes #1515.

A 32-character Algolia or Typesense key held under an admin-named variable (search_admin_api_key, adminApiKey, admin_api_key) was reported at medium, the same tier as a search-named one. An admin key can write and delete an index, so it is now a high, with a hint saying so. A search-named variable keeps medium and the search-only hint. A Meilisearch masterKey (or MEILI_MASTER_KEY, an admin name) is reported at high as Meilisearch Master Key, and a searchKey as Meilisearch Search Key at medium with the search-only hint; neither was detected before. The Meilisearch pattern needs the word meili within 40 characters in front of the key (the keyword gap of every brand pattern), so a bare masterKey of another product is not claimed.

What changed

  • Generic API Key Assignment: an admin word in the complete key name plus a 32-character alphanumeric value moves it to high (whole word: administratorApiKey, sadminApiKey do not count).
  • New Meilisearch API Key context pattern, tier chosen by the key's name (master or admin: high; search or public: medium + hint; other: medium).
  • Docs: the tier table says which variable names change the tier.
  • Tests: leaked-secrets-admin-keys-1515.test.ts (fixtures built from parts; 6 mutants killed), two assertions in the security/leaked-secrets: extend the public-by-design tier (presigned-URL AWS credential ids, beacon JWTs, search-only keys) #1229 tests updated to the new tier, a corpus generator for the new pattern and the regenerated snapshot (58 lines, all the new pattern).

Acceptance criteria

  • admin-named variable holding an Algolia/Typesense-shaped key reports at high
  • search-named variable keeps medium with the search-only hint
  • Meilisearch masterKey high, searchKey detected with the search-only hint
  • tests with fixtures built from parts; docs tier table names the variable names

Skill change: none.

…igh; Meilisearch master and search keys #1515

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9

nc9 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1523, which covers the same ground; an overlapping draft from the maintainers is closed in favour of William's. The admin-tier hint and the whole-word tests from this branch were folded into the release (v0.0.159: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.159).

nik

@nc9 nc9 closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security/leaked-secrets: a key under an admin-named variable reports at medium, same as a search-named one

1 participant