Skip to content

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

Closed

Description

@nc9

Found while reviewing #1300. Measured on the stack's second PR; the confidence tier is not what the name implies.

A key assigned to an admin-named variable (search_admin_api_key, adminApiKey) for a provider with a search/admin split is reported at medium confidence, the same tier as a search-named variable. An admin key can write and delete an index, so it belongs a tier up. Search-named variables only add a hint and stay at medium.

Also found, pre-existing on main: a Meilisearch masterKey or searchKey assignment is not detected at all.

Acceptance Criteria

  • An admin-named variable (search_admin_api_key, adminApiKey, admin_api_key) holding a provider-shaped key (Algolia, Typesense) is reported at high
  • A search-named variable (search_api_key, a Typesense search key) keeps medium confidence with the search-only hint
  • A Meilisearch masterKey is reported at high and a searchKey is detected with the search-only hint
  • Tests cover each case with fixtures built from parts (no key-shaped literal in the file), and the rule docs tier table says which variable names change the tier

nik

Activity

  1. added
    bug
    size: XS
    on Nov 1, 2026
  2. added theissue type on Nov 1, 2026
  3. WilliamK112 commented on Nov 1, 2026

    @WilliamK112
    Contributor

    I can take this. I’ll add the admin/search variable-name tiering for Algolia and Typesense, cover Meilisearch master/search keys with part-built fixtures, update the rule docs tier table, and validate the focused rule tests plus the relevant registry checks.

  4. nc9 commented on Nov 2, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.159 (William's #1523 plus a maintainer follow-up) and checked against it: every acceptance criterion is met. An admin-named variable (search_admin_api_key, adminApiKey, admin_api_key) holding a 32-character provider-shaped key reports at high with keyKind: admin-named; a search-named variable keeps medium with the search-only hint; a Meilisearch masterKey reports at high and searchKey at medium with the hint. Note the Meilisearch rule: a bare masterKey or searchKey is read only with meili in the variable name or in the 120 characters before it (documented in the rule docs and tested). Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.159

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsize: XS

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions