Skip to content

@W-23895509: Block secret values in Site preferences - #133

Merged
shauryemahajanSF merged 3 commits into
release/26.9from
shaurye.W-23895509.site-preference-scan-26.9
Aug 18, 2026
Merged

shauryemahajanSF merged 3 commits into
release/26.9from
shaurye.W-23895509.site-preference-scan-26.9

Conversation

@shauryemahajanSF

Copy link
Copy Markdown
Contributor

What

Forward-port of #123 (which targets release/26.8) into release/26.9. Cherry-picked its three commits; applied cleanly.

Adds the S20 security-scan rule that blocks storing/reading authentication secrets in Site preferences, plus the follow-up review fixes:

  • S20 check in security-scan.sh: flags secret-like SitePreferences attribute IDs (API keys, secrets, passwords, credentials, *Token) regardless of declared type, and same-line literal getCustomPreferenceValue(...) reads. Fails closed on malformed SitePreferences XML.
  • Workflows: install libxml2-utils (xmllint) in security.yml, verify-zip.yml, and test-scripts.yml — the jobs that actually run the scanner.
  • Skill/docs: site-preferences, scaffold-app, and shared security-rules updated so guidance no longer suggests storing secrets in Site preferences; rule list matches the type-agnostic scanner.
  • Tests: test-security-scan.sh covers password-typed, string-typed, non-secret, and malformed-XML cases. Full suite passes 162/0.

Why

Merchants/ISVs were storing API keys and tokens in Site preferences (unmasked in BM). This gates that at submission and steers apps to ecom service credentials / LocalServiceRegistry.

🤖 Generated with Claude Code

shauryemahajanSF and others added 3 commits August 18, 2026 15:24
…block string-typed & malformed secret prefs

- Install libxml2-utils in security.yml and verify-zip.yml (the workflows
  that actually scan CAP zips); previously only test-scripts.yml had it, so
  security-scan.sh would fail closed with "xmllint is required" or S20 would
  not run in the pipelines that matter.
- S20 now matches secret-like attribute IDs on SitePreferences regardless of
  declared <type>, catching string-typed secrets (e.g. vendorApiKey) that BM
  will not mask.
- S20 fails closed on malformed SitePreferences XML instead of silently
  skipping the file when xmllint cannot parse it.
- Add tests for string-typed secret prefs, non-secret string prefs, and
  malformed SitePreferences XML.

Co-Authored-By: Claude Opus 4.8 (1M context) <claude.noreply@salesforce.com>
The security-rules.md entry still described S20 as detecting only
password-typed Site preferences. The scanner now flags secret-like
SitePreferences attribute IDs regardless of declared type and fails
closed on malformed SitePreferences XML. Update the rule list to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <claude.noreply@salesforce.com>
@shauryemahajanSF
shauryemahajanSF force-pushed the shaurye.W-23895509.site-preference-scan-26.9 branch from 44c55dd to 1c1b60d Compare August 18, 2026 19:24
@shauryemahajanSF
shauryemahajanSF marked this pull request as ready for review August 18, 2026 19:27
@shauryemahajanSF
shauryemahajanSF requested review from a team August 18, 2026 19:27
@shauryemahajanSF
shauryemahajanSF merged commit ce93d00 into release/26.9 Aug 18, 2026
2 checks passed
@shauryemahajanSF
shauryemahajanSF deleted the shaurye.W-23895509.site-preference-scan-26.9 branch August 18, 2026 19:27
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.

1 participant