Skip to content

[scanner] autodetect: sensitive-env deny-list misses CREDS names and common vendor token prefixes (hf_, pypi-, dop_v1_, lin_api_, SG., ya29.) #344

Closed

Description

@hivecommons-hive

Summary

isSensitiveEnvName (src/autodetect.ts, SENSITIVE_ENV_PATTERN) refuses credential-looking names before the implicit process.env fallback expands a {{NAME}} blank, and before the Builder UI embeds process.env in the served page. The pattern covers CREDENTIAL but not the very common abbreviation CREDS (AWS_CREDS, GCP_CREDS, DOCKER_CREDS, REGISTRY_CREDS, DB_CREDS), so a repo-controlled template {{AWS_CREDS}} expands such a variable into the generated prompt, and promptargs ui lists it under "Show terminal env".

isSensitiveEnvValue (SENSITIVE_ENV_VALUE_PATTERN) is the backstop for innocuous names; it knows GitHub/GitLab/OpenAI/Stripe/Slack/AWS/Google/npm/Vault prefixes but not several equally fixed vendor prefixes: Hugging Face hf_, PyPI pypi-AgEI, DigitalOcean dop_v1_, Linear lin_api_, Shopify shpat_/shpss_, SendGrid SG., Databricks dapi, Grafana glc_, Google OAuth access tokens ya29..

Evidence

  • src/autodetect.ts SENSITIVE_ENV_PATTERN: alternatives are TOKEN, SECRET, PASSWORD, PASSWD, PASSPHRASE, CREDENTIAL, API_?KEY, … — CREDENTIAL does not match CREDS.
  • src/autodetect.ts SENSITIVE_ENV_VALUE_PATTERN: prefix list ends at hvs.; none of the prefixes above are present.
  • README.md "Credential-looking names are intentionally excluded…" documents the list and must be updated with the additions.

Proposed fix (single file + README + tests + dist mirror)

  1. Add CREDS? handling: replace 'CREDENTIAL' with 'CREDENTIALS?' and add '(?:^|_)CREDS(?:_|$)' so AWS_CREDS / CREDS_FILE are refused while e.g. INCREDIBLE is not.
  2. Append value prefixes to SENSITIVE_ENV_VALUE_PATTERN: ^hf_[A-Za-z0-9]{30,}, ^pypi-AgEI, ^dop_v1_[a-f0-9]{60,}, ^lin_api_, ^shp(?:at|ss|ca|pa)_[a-f0-9]{30,}, ^SG\.[\w-]{20,}\.[\w-]{20,}, ^dapi[a-f0-9]{30,}, ^glc_[A-Za-z0-9+/=]{30,}, ^ya29\.[\w-]+.
  3. Extend autodetect.test.ts (names: AWS_CREDS refused, INCREDIBLE/AUTHOR still allowed; values: one positive per new prefix, and a negative such as hf_home short value).
  4. Update the README sentence listing refused names/prefixes.
  5. Mirror the change into dist/autodetect.js (and test .js) because CI's dist-sync gate requires committed dist/.

Decision taken by hive: additive, backward-compatible tightening of an existing deny-list; no new abstraction.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 25, 2026
  2. added a commit that references this issue on Oct 25, 2026
    0435b20
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

    agent/scannerCreated by Hive for agent-filed issue provenancehelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions