fix(ci): least-privilege workflow permissions + drop a dead string replace — clears 10 CodeQL alerts - #538
Open
rubenvdlinde wants to merge 2 commits into
Open
fix(ci): least-privilege workflow permissions + drop a dead string replace — clears 10 CodeQL alerts#538rubenvdlinde wants to merge 2 commits into
rubenvdlinde wants to merge 2 commits into
Conversation
added 2 commits
August 17, 2026 06:46
…place
Clears all 10 open CodeQL alerts on `development`: 9 workflow-hardening findings
and 1 dead no-op in production code. Neither category is a vulnerability that
was exploitable, and the check-run title ("7 new alerts including 3 high
severity security vulnerabilities") overstates both. All three "high severity"
alerts are `js/insecure-randomness` in Playwright fixtures; they are handled by
dismissal, not by this commit.
1. Nine `actions/missing-workflow-permissions`, all MEDIUM, all in
`.github/workflows/`. An absent `permissions:` block means the job runs with
the repository default rather than a stated grant.
Eight of the nine only CALL a reusable workflow in ConductionNL/.github, so
the block restates what the callee's own job already declares and the
effective token is unchanged:
release-beta / release-development / release-stable contents: write
sync-to-beta contents: write + pull-requests: write
issue-triage issues: write + contents: read
openspec-sync issues: write + contents: read
documentation contents: write + packages: write (UNION of the
callee's build / deploy / image jobs)
branch-protection {} — the callee is one bash string comparison with
no checkout, no network and no API call
code-quality is the exception and the only risky one. Most jobs in the shared
quality pipeline declare no permissions of their own, so they inherit the
caller ceiling exactly. The block used is copied verbatim from openconnector,
where it is live on `development` with ~30 quality jobs green — a measured
ceiling, not a guess.
A caller block is a CEILING, not a grant: GitHub validates the callee's
declared job permissions against it, including for jobs an `if:` will skip,
so tightening one to `read` makes the call fail to START with zero jobs.
2. One `js/identity-replacement` (MEDIUM) at src/views/Dashboard.vue:496 —
`.replace(',', ',')`, replacing the comma with itself.
It was born in that identical form in 5c33f0b ("Working on the detail
pages"), so it never worked and no intent is recorded to recover. Deleting it
is output-preserving: `formatDate` still returns `17/08/2026, 08:33`,
verified against the actual string. Guessing at `.replace(',', '')` would
have invented a UI change nothing asked for.
Checked and ruled out while here: `toLocaleDateString` with explicit
`hour`/`minute` options DOES emit the time (ECMA-402 supplies date-part
defaults only when none are given), so this was not the "the time is silently
missing" bug it resembles. Measured, not assumed.
Verified: all 11 workflows parse, and a job-level sweep reports 0 jobs without a
block, against 9 before the change — the same 9 CodeQL names.
…image defaults to true The comment claimed `packages: write` was needed only because GitHub statically validates a callee's declared job permissions, and that the `image` job "never runs" here. That is wrong on the second half. `build-image` in ConductionNL/.github/.github/workflows/documentation.yml is `type: boolean, default: true`, and none of the callers pass it. So the `image` job DOES run on a push to `documentation`, and it really does `docker buildx` push to GHCR. `packages: write` is load-bearing at RUNTIME, not merely statically — dropping it would 403 that push. Comment only; the permissions block itself is unchanged and was already correct.
Contributor
Quality Report — ConductionNL/softwarecatalog @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-vue-demi | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| composer | ✅ | ✅ 130/130 | |||
| npm | ✅ | ✅ 704/704 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ⏭️ | ||||
| Playwright | ❌ | ||||
| Hydra gates | ❌ |
Quality workflow — 2026-08-17 04:56 UTC
Download the full PDF report from the workflow artifacts.
Contributor
Quality Report — ConductionNL/softwarecatalog @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-vue-demi | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| composer | ✅ | ✅ 130/130 | |||
| npm | ✅ | ✅ 704/704 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ⏭️ | ||||
| Playwright | ❌ | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-08-17 05:13 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is, accurately
The
CodeQLcheck-run ondevelopmentis red with the title"7 new alerts including 3 high severity security vulnerabilities". That
title materially overstates what is there. Measured distribution of the 10
open alerts on
refs/heads/development:.github/workflows/*.ymlactions/missing-workflow-permissionstests/e2e/workflows/js/insecure-randomnesssrc/js/identity-replacementAll three "high severity security vulnerabilities" in the title are
Math.random()in Playwright fixture code. The only production alert ismedium and is a dead string operation. This is Actions-hardening debt plus one
no-op — not a security incident.
1. Nine workflow alerts
An absent
permissions:block does not mean a job was compromised — it meansthe job ran with the repository default grant instead of a stated one.
Eight of the nine only call a reusable workflow in
ConductionNL/.github, sothe block is not a new grant: the callee's own job already declares the same
set and the effective token is unchanged.
release-beta/release-development/release-stablecontents: writeNEXTCLOUD_APPSTORE_TOKENsync-to-betacontents: write,pull-requests: writegh pr createissue-triageissues: write,contents: readopenspec-syncissues: write,contents: readsyncdocumentationcontents: write,packages: writebranch-protection{}code-qualitycontents: write,actions: write,issues: write,pull-requests: write,packages: readcode-qualityis the one that could have brokenMost jobs in the shared
quality.ymldeclare no permissions of their own, sothey inherit the caller ceiling exactly. Every entry is load-bearing:
contents: writefor the journeydoc / baselinegit push,actions: writeforthe re-dispatch,
issues+pull-requests: writefor the Quality Reportcomment (
issues.createComment, which 403s under read-only —quality.ymldocuments this at its own step),
packages: readfor pulling org images.The block is copied verbatim from openconnector, where it is live on
developmentwith ~30 quality jobs green. A measured ceiling, not a guess.A caller block is a CEILING, not a grant. GitHub validates the callee's
declared job permissions against it — including for jobs an
if:will skip — sotightening one to
readmakes the call fail to start with zero jobs and noannotations, which is quieter than the red it replaces.
packages: writeondocumentationis load-bearing at runtime as well: thecallee's
build-imageinput isdefault: trueand no caller overrides it, sothe
imagejob really does run on a push todocumentationand pushes to GHCR.(An earlier revision of this PR's comments claimed otherwise — corrected in the
second commit.)
2. The single production alert — a dead operation, deleted
js/identity-replacement, medium,src/views/Dashboard.vue:496:.replace(',', ',')— "this replaces ',' with itself."Before deleting it I checked what it was meant to do, because a dead
operation is often a bug in disguise:
git log -Sputs it in5c33f0b("Working on the detailpages") in exactly this identical form. It has never done anything, so no
working behaviour was lost and there is no recorded intent to recover.
formatDatecallstoLocaleDateStringwhile passinghour/minute, which resembles the"the time is silently dropped" trap. It is not: ECMA-402 supplies date-part
defaults only when no options are given, so explicit
hour/minutearehonoured. Measured — the function returns
17/08/2026, 08:33, comma and timeboth present.
So the comma the call targets does exist, and replacing it with itself is a true
no-op. Deleting it is output-preserving, verified against that string.
Guessing at
.replace(',', '')would have invented a UI change nothing askedfor, so it was not done.
3. The three test alerts — not fixed here, dismissed with a reason
js/insecure-randomness(high) atcrud-persistence.spec.ts:115,organisatie-crud.spec.ts:69,org-export-workflow.spec.ts:75. All three traceto one source,
tests/e2e/workflows/_fixtures.ts:40:RUN_IDis a collision-avoidance suffix for Playwright fixture object namesin a disposable test database. It is not a token, secret, password, session id or
nonce, and nothing authenticates or authorises against it.
Math.random()is theright tool for the job it is doing. Three alerts, one source, three sinks.
Dismissed as
used in testswith the reasoning recorded on each alert. Therule is left enabled — no blanket suppression.
Verification
yaml.safe_load).permissions:block.developmenttreereports 9, the same 9 job names CodeQL flagged. The check can say NO.
Not in scope, but found while measuring
quality / E2E Tests (Playwright)is red ondevelopmentfor an unrelated andreal product bug — the Standards index page is configured against register
voorzieningen+ schemaelement, butelementis attached to thevng-gemmaregister. Filed separately; this PR does not touch it.