Skip to content

Address open code scanning alerts - #454

Merged
mlapaglia merged 1 commit into
developfrom
fix-code-scanning
Nov 16, 2026
Merged

mlapaglia merged 1 commit into
developfrom
fix-code-scanning

Conversation

@mlapaglia

Copy link
Copy Markdown
Owner

Fixes the 7 open code scanning alerts on develop.

Log forging (alert #7, error)

WebhookController logged the raw request body when a webhook payload wasn't recognized. The endpoint is unauthenticated, so a body containing line breaks could write fake entries into the log. The body is now logged with \r and \n removed and cut to its first 1000 characters, along with its full length.

Workflow token permissions (alerts #1–6, warnings)

Both workflows now default to permissions: contents: read. Only these jobs get more:

Workflow Job Permissions Why
docker-publish.yml windows-build-push contents: write Creates the GitHub release with softprops/action-gh-release
cleanup-alpha-releases.yml cleanup-alpha-releases contents: write, packages: read Deletes alpha releases and their tags; lists container package versions

The other jobs only read the repo. The Docker Hub push and SonarQube analysis use their own secrets, not GITHUB_TOKEN.

Testing

  • dotnet build succeeds; dotnet test: 1556 passed, 2 skipped.
  • The permission changes can't be exercised on a PR, because the release and cleanup jobs only run when a version tag is pushed. If either fails with a 403 on the next release, that job needs another permission.

🤖 Generated with Claude Code

- Strip line breaks from the unrecognized webhook payload before logging it,
  and cap it at 1000 characters, so unauthenticated input can't forge log
  entries (cs/log-forging).
- Default both workflows to a read-only GITHUB_TOKEN and grant write access
  only to the jobs that need it: contents: write for the Windows release job,
  and contents: write plus packages: read for the alpha release cleanup
  (actions/missing-workflow-permissions).
@sonarqubecloud

Copy link
Copy Markdown

@mlapaglia
mlapaglia merged commit 50d92af into develop Nov 16, 2026
11 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.

1 participant