You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[scanner] autodetect: sensitive-env deny-list misses CREDS names and common vendor token prefixes (hf_, pypi-, dop_v1_, lin_api_, SG., ya29.) #344
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.
Add CREDS? handling: replace 'CREDENTIAL' with 'CREDENTIALS?' and add '(?:^|_)CREDS(?:_|$)' so AWS_CREDS / CREDS_FILE are refused while e.g. INCREDIBLE is not.
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-]+.
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).
Update the README sentence listing refused names/prefixes.
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.
Activity
🐛 fix(autodetect): refuse CREDS env names and more vendor token prefi…