Skip to content

fix: port security, Mergify, and CI fixes from release/v1.0.0 to develop - #2362

Merged
mergify[bot] merged 2 commits into
developfrom
fix/develop-security-and-ci-fixes-v2
Aug 27, 2026
Merged

fix: port security, Mergify, and CI fixes from release/v1.0.0 to develop#2362
mergify[bot] merged 2 commits into
developfrom
fix/develop-security-and-ci-fixes-v2

Conversation

@eleshar

Copy link
Copy Markdown
Contributor

Linked issues

Relates to #2351 (relates LS-2809). Ports fixes from release/v1.0.0 (#2355, #2356, #2358, #2359, #2360, #2361) that never reached develop.

Changelog

Fixed

  • Security:metadata-governance.yml checked out the PR submitter's fork branch under pull_request_target while holding a token scoped issues:write/pull-requests:write/repository-projects:write — a pwn request vulnerability. Fixed here specifically because for pull_request_target-triggered workflows, GitHub resolves the workflow definition from the repository's actual default branch (develop), not from whatever branch a PR targets. The identical fix on release/v1.0.0 (fix(workflows): close pull_request_target fork-checkout hole; bump actions to latest #2355) never applied to real contributor PRs against develop, where this workflow actually runs.
  • Mergify:merge_protections_settings.auto_merge_conditions: true was unconditionally auto-merging any mergeable PR, from any author. develop's branch protection requires only the validate-pr-template check, so this merged PRs the instant that one check passed — ignoring tests, linting, and security scans entirely. Restricted to the same bot-author condition already used throughout this file (dependabot/imgbot/lightspeed-bot).
  • Node/CI:.nvmrc/package.json/workflows were split across Node 18/20/22/lts — including 20, which is deprecated on GitHub's hosted runners. Standardised on 24 (current Active LTS). Bumped stale actions/* pins to their current latest majors (verified via the GitHub API against each project's actual releases).
  • Module system: 32 scripts used CommonJS (require/module.exports) while package.json declares "type": "module", causing ReferenceError: require is not defined in ES module scope the moment a workflow actually ran them. Renamed to .cjs and fixed every reference — literal paths, extensionless require() calls, and requires embedded inside actions/github-script blocks in YAML. Re-ran a full repo-wide reference scan afterward: zero stale references remain.

Risk Assessment

Risk Level: Medium

Potential Impact: Touches CI/automation scripts and one security-relevant workflow, not production application code. The Mergify change alters merge automation behaviour repo-wide — after this merges, non-bot PRs against develop will no longer auto-merge on validate-pr-template alone and will need to pass whatever checks are actually required, or be merged manually.

Mitigation Steps: Every fix here already landed and was verified on release/v1.0.0 first (separate PRs, separate CI runs) before being ported. The CJS renames were found via an automated dependency-graph walk from every real workflow entrypoint (including YAML-embedded require() calls), not manual guessing, and re-verified with a zero-result final scan.

How to Test

Prerequisites

None.

Test Steps

  1. Open a PR against develop from a fork and confirm metadata-governance.yml no longer checks out the fork's branch (checkout step should show no repository:/ref: override).
  2. Open a PR from a non-bot author and confirm it does NOT auto-merge on validate-pr-template passing alone.
  3. Trigger any of the 32 renamed scripts via their workflow (e.g. Meta Agent validation, OpenSpec label sync, metrics collection) and confirm no ReferenceError: require is not defined.

Expected Results

No module-resolution errors; Mergify no longer auto-merges non-bot PRs; the fork-checkout vulnerability is closed on the branch that actually matters.

Edge Cases to Verify

  • Full repo-wide reference scan re-run after all renames — zero stale references remain
  • All 63 workflow YAML files re-validated for syntax after every edit

Checklist (Global DoD / PR)

  • Security fix verified against the actual vulnerable pattern (fork-head ref:/repository: override removed)
  • Mergify config change scoped to the single setting responsible, existing bot rules untouched
  • Dependency-graph walk re-run twice (initial + expanded entrypoints) until zero new stale references found

…n metadata-governance.yml
metadata-governance.yml checked out the PR submitter's fork branch
(github.event.pull_request.head.ref) under pull_request_target while
holding a token scoped issues:write/pull-requests:write/repository-
projects:write, then executed scripts from that checkout. A PR could
edit those scripts to run arbitrary code with that token. Per GitHub's
securely-using-pull_request_target guidance, pull_request_target must
only ever execute trusted code from the base repository's default
branch.
This is the same vulnerability already fixed on release/v1.0.0
(PR #2355), ported here because for pull_request_target-triggered
workflows GitHub resolves the workflow *definition* from the
repository's actual default branch (develop), not from whatever
branch the PR targets — so the release/v1.0.0 fix never applied to
real contributor PRs against develop, where this workflow actually
runs.
… CommonJS/ESM breakage
Ports the same three fixes already applied and verified on
release/v1.0.0 (PRs #2358, #2359, #2360) to develop — the repository's
actual default branch, where pull_request_target-triggered workflows
resolve their *definition* from, regardless of what branch a PR
targets. The release/v1.0.0 fixes never reached these code paths.
1. Node version drift: .nvmrc said 22, package.json engines said
>=18, workflows hardcoded a mix of "18"/"20"/"22"/"lts/*" for
setup-node (including "20", deprecated on GitHub's hosted
runners). Standardised on 24 (current Active LTS per nodejs.org)
across .nvmrc, package.json engines.node, and every workflow.
Verified no node-version matrix strategies exist, so a blanket
normalise was safe.
2. Stale action versions: bumped actions/checkout, setup-node,
upload-artifact, download-artifact, github-script,
create-github-app-token, tj-actions/changed-files, and
add-to-project to their current latest majors — verified via the
GitHub API against each project's actual releases, and checked
release notes for breaking changes before bumping. Includes two
vendored skill workflow files under agents/*/skills/ that carried
the same stale pins.
3. CommonJS scripts crashing under this repo's "type": "module":
found via the same dependency-graph-walk methodology used on
release/v1.0.0, but starting fresh from develop's actual entrypoint
set — which differs from release/v1.0.0's (some files already
converted to real ESM here, e.g. issues.agent.js/planner.agent.js;
others broken here that weren't there, e.g. the Meta Agent skills
and scripts/agents/includes/label-sync.js). Renamed 32 files to
.cjs and fixed every reference — literal .js paths, extensionless
require() calls (this repo's .jest.config.cjs excludes 'cjs' from
moduleFileExtensions, so Jest doesn't auto-resolve it either), and
requires embedded inside actions/github-script blocks in YAML,
which a naive `node scripts/....js`-only entrypoint scan misses
entirely. Re-ran the full closure and a repo-wide reference scan
afterward: zero stale references remain.
@coderabbitai

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 111 files, which is 11 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: a780a28e-2fd0-49b2-a82d-99e04bf834f7

📥 Commits

Reviewing files that changed from the base of the PR and between 6da85d3 and b1f8859.

⛔ Files ignored due to path filters (1)
  • .jest-skip/label-sync.test.js is excluded by !.jest-skip/**
📒 Files selected for processing (111)
  • .github/mergify.yml
  • .github/scripts/workflows/__tests__/metrics-collection-orchestrator.test.js
  • .github/scripts/workflows/metrics-collection-orchestrator.cjs
  • .github/scripts/workflows/metrics-reporting-orchestrator.cjs
  • .github/workflows/actions-minute-savings-watch.yml
  • .github/workflows/allocate-pr-issue-to-milestone.yml
  • .github/workflows/badges-verification.yml
  • .github/workflows/branch-name-validation.yml
  • .github/workflows/changelog-management.yml
  • .github/workflows/checklist-finalisation.yml
  • .github/workflows/docs-maintenance.yml
  • .github/workflows/docs-validation.yml
  • .github/workflows/documentation.yml
  • .github/workflows/issue-create-enhanced.yml
  • .github/workflows/issue-create-from-template.yml
  • .github/workflows/issue-health-audit.yml
  • .github/workflows/issue-labeling-automation.yml
  • .github/workflows/issue-project-field-sync.yml
  • .github/workflows/issue-remediation-automation.yml
  • .github/workflows/issue-remediation-bulk.yml
  • .github/workflows/labeling-governance.yml
  • .github/workflows/labeling.yml
  • .github/workflows/main-branch-guard.yml
  • .github/workflows/manage-blocking-status-labels.yml
  • .github/workflows/meta-agent-validation.yml
  • .github/workflows/metadata-governance.yml
  • .github/workflows/metrics-collection.yml
  • .github/workflows/metrics-pipeline.yml
  • .github/workflows/metrics-reporting.yml
  • .github/workflows/openspec-progress-phase.yml
  • .github/workflows/openspec-report-progression.yml
  • .github/workflows/openspec-sync-labels.yml
  • .github/workflows/openspec-validate-labels.yml
  • .github/workflows/pr-template-validation.yml
  • .github/workflows/project-archival.yml
  • .github/workflows/project-maintenance-nightly.yml
  • .github/workflows/project-maintenance-on-demand.yml
  • .github/workflows/project-meta-sync.yml
  • .github/workflows/release-e2e-tests.yml
  • .github/workflows/release.yml
  • .github/workflows/reporting.yml
  • .github/workflows/reviewer.yml
  • .github/workflows/template-enforcement.yml
  • .github/workflows/validate-blocking-issue-before-close.yml
  • .github/workflows/validate-blocking-status-before-close.yml
  • .github/workflows/validate-dor-dod-sections.yml
  • .github/workflows/validate-issue-dod-before-close.yml
  • .github/workflows/validate-mermaid-pr.yml
  • .github/workflows/validate-pr-template.yml
  • .github/workflows/validate-project-linking.yml
  • .nvmrc
  • agents/client-website-discovery-assistant-agent/skills/agent-attached/hermes/design-md-generator/assets/github-actions/design-md-lint.yml
  • agents/design-partner-agent/skills/agent-attached/hermes/design-md-generator/assets/github-actions/design-md-lint.yml
  • agents/meta-agent/__tests__/apply-standards.test.js
  • agents/meta-agent/__tests__/frontmatter-validation.test.js
  • agents/meta-agent/__tests__/generate-badges.test.js
  • agents/meta-agent/__tests__/integration/ci-workflows.test.js
  • agents/meta-agent/__tests__/integration/full-workflow.test.js
  • agents/meta-agent/__tests__/metadata-extraction.test.js
  • agents/meta-agent/__tests__/repo-type-detection.test.js
  • agents/meta-agent/index.cjs
  • agents/meta-agent/skills/apply-standards.cjs
  • agents/meta-agent/skills/frontmatter-validation.cjs
  • agents/meta-agent/skills/generate-badges.cjs
  • agents/meta-agent/skills/metadata-extraction.cjs
  • agents/meta-agent/skills/repo-type-detection.cjs
  • package.json
  • scripts/agents/includes/__tests__/label-sync.test.js
  • scripts/agents/includes/__tests__/milestone-assignment.test.js
  • scripts/agents/includes/label-sync.cjs
  • scripts/agents/includes/milestone-assignment.cjs
  • scripts/agents/includes/remediation-checklist-generator.cjs
  • scripts/automation/__tests__/dor-dod-validation.test.js
  • scripts/automation/__tests__/orchestrate-phase-progression.test.js
  • scripts/automation/__tests__/phase-3-integration.test.js
  • scripts/automation/__tests__/phase-3-orchestration.test.js
  • scripts/automation/__tests__/sync-labels-on-event.test.js
  • scripts/automation/dor-dod-templates.cjs
  • scripts/automation/handlers/handle-issue-closed.cjs
  • scripts/automation/handlers/handle-issue-created.cjs
  • scripts/automation/handlers/handle-issue-labeled.cjs
  • scripts/automation/handlers/handle-pr-merged.cjs
  • scripts/automation/handlers/handle-pr-opened.cjs
  • scripts/automation/handlers/orchestrate-phase-progression.cjs
  • scripts/automation/handlers/sync-labels-on-event.cjs
  • scripts/automation/includes/audit-logger.cjs
  • scripts/automation/includes/label-validator.cjs
  • scripts/automation/includes/phase-state-machine.cjs
  • scripts/automation/validate-inject-dor-dod.cjs
  • scripts/fix-mermaid-diagrams.cjs
  • scripts/fix-staleness-dates.cjs
  • scripts/metrics/__tests__/anomaly-detector.test.js
  • scripts/metrics/__tests__/metrics-agent-integration.test.js
  • scripts/metrics/__tests__/metrics-agent.test.js
  • scripts/metrics/__tests__/metrics-storage.test.js
  • scripts/metrics/__tests__/trend-analyzer.test.js
  • scripts/metrics/anomaly-detector.cjs
  • scripts/metrics/metrics-agent.cjs
  • scripts/metrics/metrics-storage.cjs
  • scripts/metrics/trend-analyzer.cjs
  • scripts/workflows/assign-milestones-workflow.cjs
  • scripts/workflows/metrics/__tests__/collect-metrics.test.js
  • scripts/workflows/metrics/collect-metrics.cjs
  • scripts/workflows/orchestrate-phase-progression.cjs
  • tests/js/import-includes-smoke.test.js
  • workflows/ai-feedback-validation.yml
  • workflows/issue-remediation-automation.yml
  • workflows/metrics-collection.yml
  • workflows/orchestrate-phase-progression.yml
  • workflows/pr-creation-agent-integration-tests.yml
  • workflows/validate-issue-labels.yml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergifyBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking

ProtectionWaiting on
🔴🚦 Auto-queue
🟢📃 Configuration Change Requirements

🔴 🚦 Auto-queue

This rule is failing.

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • author~=^(dependabot\[bot\]|app/dependabot|imgbot\[bot\]|app/imgbot|lightspeed-bot)$

Show 1 satisfied protection

🟢 📃 Configuration Change Requirements

Mergify configuration change

  • check-success = Configuration changed

@github-actionsgithub-actionsBot added status:needs-review Awaiting code review type:bug Bug or defect priority:normal Default priority labels Aug 27, 2026
@mergifymergifyBot added the queued label Aug 27, 2026
@github-actionsgithub-actionsBot added area:ci Build and CI pipelines area:dependencies Composer/npm dependency work labels Aug 27, 2026
@mergify

mergifyBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-27 13:02 UTC · Rule: dependabot-develop · triggered by merge protections
  • Checks skipped · PR is already up-to-date
  • Merged2026-08-27 13:02 UTC · at b1f885908eed5f46aa285eda42d7bb0e2b686c55 · squash

This pull request spent 22 seconds in the queue, including 3 seconds running CI.

Required conditions to merge
  • any of [🛡 GitHub branch protection]:
    • check-success = validate-pr-template
    • check-neutral = validate-pr-template
    • check-skipped = validate-pr-template

@github-actionsgithub-actionsBot added area:tests Test suites & harnesses area:scripts Scripts & tooling labels Aug 27, 2026
@github-actions

github-actionsBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

⏱️ Aging and SLA annotation

  • Age: 0 day(s)
  • SLA state: Within SLA
  • Thresholds: warn at 7 days, breach at 14 days
  • Last updated: 2026-08-27T13:04:15.446Z

Maintained by project-meta-sync workflow.

@github-actionsgithub-actionsBot added lang:js JavaScript/TypeScript lang:json JSON config/content lang:yaml YAML config type:chore Chore / small hygiene change meta:needs-changelog Requires a changelog entry before merge labels Aug 27, 2026
@mergify
mergifyBot merged commit b65246c into developAug 27, 2026
27 of 35 checks passed
@mergify
mergifyBot deleted the fix/develop-security-and-ci-fixes-v2 branch August 27, 2026 13:02
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2362

CI Status:success
Files changed: 112
Risk Distribution: 46 critical, 5 high, 22 medium, 39 low

Recommendations

  • ⚠️ 46 critical-risk file(s) modified (workflows, secrets)
  • ⚠️ Security-sensitive files modified (review carefully)

@mergifymergifyBot removed the queued label Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Milestone Allocation

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ciBuild and CI pipelinesarea:dependenciesComposer/npm dependency workarea:scriptsScripts & toolingarea:testsTest suites & harnesseslang:jsJavaScript/TypeScriptlang:jsonJSON config/contentlang:yamlYAML configmeta:needs-changelogRequires a changelog entry before mergepriority:normalDefault prioritystatus:needs-reviewAwaiting code reviewtype:bugBug or defecttype:choreChore / small hygiene change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@eleshar