fix: unblock check and secrets CI failures#38353
Conversation
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🟠 Secret scanning bypass via broad
|
| Property | Value |
|---|---|
| Severity | High |
| CWE | CWE-693 |
| Location | .secrets.baseline:129-132 |
Description
The detect-secrets baseline was updated to exclude entire directory classes (dist/ and vendor/) from scanning:
detect_secrets.filters.regex.should_exclude_filenow matches any file path that contains a/dist/or/vendor/segment (or starts withdist//vendor/), causing all files under any such directory to be skipped.- The same regex also excludes
.detect-secrets.cfg, meaning secrets added to that file will not be detected. - In CI, the “Detect secrets” job on pull requests runs detect-secrets only on the changed files list (fast path). If an attacker adds a secret in an excluded path (e.g.,
vendor/...), the file will be part of--filesbut will still be skipped by the exclusion regex, allowing the secret to be committed undetected by this control.
This is particularly relevant because the repo contains vendored directories (e.g., vendor/a2ui/ and src/auto-reply/reply/export-html/vendor/), which are now entirely outside secret scanning coverage.
Vulnerable configuration:
"pattern": [
"(^|/)(dist/|vendor/|pnpm-lock\\.yaml$|\\.detect-secrets\\.cfg$)"
]Recommendation
Avoid globally excluding broad directory names like vendor/ (and dist/ if it can contain checked-in artifacts). Instead:
- Narrow exclusions to known-safe, specific paths (vendored third-party trees you never want to scan), and keep everything else scanned.
- Do not exclude
.detect-secrets.cfgentirely; if it causes false positives, exclude specific lines/patterns instead. - Add a compensating control: run a scheduled (or manual) full-repo detect-secrets scan that does not exclude these directories.
Example safer --exclude-files / baseline regex (tailor to your exact vendored locations):
# only exclude specific vendored trees, not any directory named "vendor"
- --exclude-files
- '(^|/)(pnpm-lock\.yaml$|vendor/a2ui/|src/auto-reply/reply/export-html/vendor/)'If dist/ must be excluded, prefer excluding only the repo-root build output:
- --exclude-files
- '^(dist/|pnpm-lock\.yaml$)'Analyzed PR: #38353 at commit 3b13e56
Last updated on: 2026-03-06T22:24:48Z
Greptile SummaryThis PR fixes two CI regressions: a TypeScript
Confidence Score: 5/5
Last reviewed commit: 8fe48ae |
b3c60a2 to
8e5a326
Compare
a027ba9 to
3b13e56
Compare
Summary
checkwas failing onmainbefore20db7afd5because Feishu media calls had invalid per-calltimeoutproperties, and PRsecretsruns were failing in two ways: first by falling back to a full-repo scan when the shallow checkout lacked the base SHA, then by requiring a refreshed.secrets.baselineonce the scan was correctly limited to changed files.secretswas diffing against incomplete history or while the generated baseline update was missing from the branch.extensions/feishu/src/media.test.ts, added the sharedensure-base-commitstep to thesecretsjob before changed-file diffing, and refreshed.secrets.baselineso the changed-file secret scan no longer rewrites tracked metadata.mainpush skip-policy changes, and no new Feishu runtime behavior beyond test coverage.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
None.
Security Impact (required)
NoNoYesNoNoYes, explain risk + mitigation:The
secretsCI job now fetches the PR base ref before diffing changed files. This is limited to the PR base branch onoriginand reuses the existing sharedensure-base-commitaction already used by other CI jobs.Repro + Verification
Environment
httpTimeoutMs: 120_000Steps
checkjob 66086536179, the fallback-path PRsecretsjob 66088689815, and the changed-files PRsecretsjob 66094255246.pnpm tsgoandpnpm vitest run extensions/feishu/src/media.test.tslocally on the rebased branch.645c2826414ec1cd6d60c2695304cb70ffe79dcfwith baseab5fcfcc01281f1f6cd6e8f43f7c302c12806feb, then runpython3 -m pre_commit run detect-secrets --files .github/workflows/ci.yml extensions/feishu/src/media.test.ts extensions/feishu/src/media.ts .secrets.baseline.Expected
checkpasses TypeScript validation.secretsscans only changed files instead of falling back to a full-repo scan.detect-secretshook passes without rewriting.secrets.baseline.Actual
checkfailed withTS2353on Feishu media request objects.secretsloggedFalling back to full detect-secrets scan.because the shallow checkout did not contain the base SHA.secretsfailed becausedetect-secretsrewrote.secrets.baselineand exited non-zero.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm tsgo,pnpm vitest run extensions/feishu/src/media.test.ts, andpython3 -m pre_commit run detect-secrets --files .github/workflows/ci.yml extensions/feishu/src/media.test.ts extensions/feishu/src/media.ts .secrets.baselineon the rebased branch.createFeishuClient; the PR diff path works once the base commit is present; the baseline no longer rewrites during the changed-file secret scan.Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
main.extensions/feishu/src/media.test.ts,.github/workflows/ci.yml,.secrets.baselinesecretsloggingFalling back to full detect-secrets scan.,detect-secretsasking to stage.secrets.baseline, or Feishu timeout regression coverage disappearing frommedia.test.ts.Risks and Mitigations
.secrets.baseline.detect-secretshook used in CI.ensure-base-commitdeepens incrementally and then fetches the full base ref if needed.Post-rebase Follow-up
3b13e56c6maincommitc301c5d08check66094971631secrets66094930426actionlint66094930448.github/workflows/auto-response.ymlonmainadded the newr: no-ci-prreply as a multiline template literal that broke YAML parsing insidescript: |..github/workflows/ci.ymlinterpolated${{ github.* }}directly inside shellrun:blocks, whichzizmorflagged astemplate-injection.r: no-ci-prauto-response message in a YAML-safe JS array/join formgithubcontext values into stepenvvariables before shell use in thesecretsjobzizmorignore anymorepnpm checkpnpm vitest run extensions/feishu/src/media.test.tspython3 -m pre_commit run actionlint --files .github/workflows/auto-response.yml .github/workflows/ci.ymlpython3 -m pre_commit run detect-secrets --files .github/workflows/ci.yml .github/workflows/auto-response.yml .secrets.baselinezizmorbinaryv1.22.0:/tmp/zizmor-v1.22.0/zizmor --persona=regular --min-severity=medium --min-confidence=medium .github/workflows/ci.yml .github/workflows/auto-response.ymlzizmorstill reportsdangerous-triggerson.github/workflows/auto-response.ymlbecause it usespull_request_target; that finding is currently unsuppressed on this branch.