Skip to content

Conversation

@summeroff
Copy link
Contributor

Potential fix for https://github.com/streamlabs/crash-handler/security/code-scanning/3

To fix this issue, explicitly set the permissions block in the workflow, granting the least possible privilege needed to perform the formatting checks. In this case, since the workflow does not push, comment, or perform any write actions, only minimal read access to the repository contents is needed. Insert permissions: contents: read either at the root (applies to all jobs) or at the job level (specific to this job). In this solution, we will add the block at the job level for clang-format-check on line 13 so it is clear and contained.

What to do:
Edit .github/workflows/clang-format.yml, adding the following under the job definition (jobs: clang-format-check:), before runs-on: ubuntu-22.04:

permissions:
  contents: read

No other changes or imports are required.


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

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@summeroff summeroff requested a review from Copilot October 7, 2025 00:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a GitHub security code scanning alert by adding explicit permissions to the clang-format workflow. The change follows the principle of least privilege by granting only the minimal read access required for the formatting check job.

  • Added job-level permissions block to restrict access to contents:read only

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@summeroff summeroff marked this pull request as ready for review October 7, 2025 00:38
@summeroff summeroff merged commit 99bc967 into streamlabs Oct 7, 2025
10 checks passed
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.

2 participants