Skip to content

ak-/as- vendor pattern matches kebab-case English, silently skipping goal-directed audit lanes #822

Closed

Description

@aviggiano

Summary

SECRET_PATTERNS contains

/\b(?:ak|as)-[A-Za-z0-9_-]{16,}\b/gu

Because the suffix class permits -, this matches ordinary kebab-case English wherever the fragment as- or ak- appears followed by 16 or more characters. as- in particular is extremely common in hyphenated identifiers and slugs: "treated-**as-**private-to-the-protocol", "classified-**as-**internal-only-configuration-value".

This is a vendor pattern, not one of the speculative heuristics, so it fires even under the "positive-only" publication scan proposed in #819 / #820.

Impact

It fails artifact publication on clean output, and the failure is silent in a way the other gate failures were not.

In a real campaign this killed the verify:goal-plan node. That node is continueOnFail, so the run did not stop — it kept going and reported healthy progress. But two dynamic groups are sourced from verify:goal-plan:

class-goals  <- verify:goal-plan
threat-goals <- verify:goal-plan

Neither can expand once that verifier has failed, so the entire goal-directed portion of the audit is skipped while the run still finishes and reports success. An operator watching node counts sees nothing wrong.

Reproduction

All three reproduce on main (8caf159f). None contains a secret.

import { containsSensitiveSecrets } from "@ultrafuzz/security";

containsSensitiveSecrets("policy.record-treated-as-private-to-the-service");      // true
containsSensitiveSecrets("classified-as-internal-only-configuration-value");      // true
containsSensitiveSecrets("resources-marked-ak-restricted-to-the-owner-role");     // true

Agent-generated goal identifiers are exactly this shape — dotted namespace plus a hyphenated description — so the collision is routine rather than unlucky.

Proposed fix

Drop - from the suffix character class:

/\b(?:ak|as)-[A-Za-z0-9_]{16,}\b/gu

Credentials in this family are opaque tokens and do not contain hyphens; kebab-case prose always does. Verified against realistic key shapes — ak-AbCdEf1234567890XyZwVuTs, as-9f2b7c1d4e6a8b0c3d5e7f90, ak-AbCdEf_1234567890_XyZwVu are all still detected, and all three prose cases above become clean.

Note that snake_case prose (treated_as_private_to_the_protocol_value) never matched, because _ is a word character and the leading \b cannot fire. Only the hyphenated form is affected.

Related

Same family as #819: a rule calibrated for credential text misfiring on ordinary technical prose. This one is narrower and has an exact fix, so it is filed separately.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions