Skip to content

Potential fix for code scanning alert no. 110: Workflow does not contain permissions#7130

Merged
SamTV12345 merged 1 commit into
developfrom
alert-autofix-110
Sep 12, 2025
Merged

Potential fix for code scanning alert no. 110: Workflow does not contain permissions#7130
SamTV12345 merged 1 commit into
developfrom
alert-autofix-110

Conversation

@SamTV12345

Copy link
Copy Markdown
Member

Potential fix for https://github.com/ether/etherpad-lite/security/code-scanning/110

To fix the problem, you should explicitly set the permissions key that restricts the GitHub Actions token's access according to the principle of least privilege. Given the context, most steps like checkout, cache, setup, and install only require read access to repository contents. The publish step does not require modification of GitHub repository content, but it interacts with npm using a secret, so the permission for secrets is managed through the workflow but doesn’t require additional repository writes. Therefore, the lowest sufficient privilege for GitHub-related actions is contents: read. This should be set at the root (top-level) of the workflow so it applies to the entire workflow, ensuring no job will be granted more permission than necessary unless specifically overridden.

The explicit addition should be at the top, after the workflow name and before the on: block. No imports, definitions, or further code edits are needed.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@SamTV12345 SamTV12345 marked this pull request as ready for review September 12, 2025 19:52
@SamTV12345 SamTV12345 merged commit 768400d into develop Sep 12, 2025
28 of 31 checks passed
@SamTV12345 SamTV12345 deleted the alert-autofix-110 branch September 12, 2025 19:52
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