Repository navigation
Potential fix for code scanning alert no. 9: Workflow does not contain permissions - #218
Conversation
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@dex-the-ai can you review this for me? Ensure that it covers all vulnurabilities described on https://github.com/couchbase-examples/nextjs-quickstart/security/code-scanning and if it doesn't, add fixes for each. |
Use same-origin relative URLs for the create, delete, and update profile requests instead of the request-derived origin, URL-encode user-supplied query values (search, pid), and drop the now-unused `req` destructuring in getServerSideProps so lint passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ejscribner I reviewed the PR against the open code scanning alerts. It fixed 2 of the 5 open alerts. I pushed d1f87aa to fix the other 3.
Other issues I found:
Validation (local, on d1f87aa)
CodeQL should close #5, #6 and #7 when it re-scans this branch. |
|
@dex-the-ai can you also fix the test failure? |
|
@ejscribner The I re-ran the failed job and it now passes: run 36739886147, attempt 2. Every step passed, including (The failure before that, on bee0582, was a real lint error: If ECR throttling keeps happening, we could pull the image from an authenticated registry or add a retry. I've left the workflow alone to keep this PR focused on the security alerts. |
Potential fix for https://github.com/couchbase-examples/nextjs-quickstart/security/code-scanning/9
Add an explicit
permissionsblock to the workflow with least privilege required for current behavior. The best single fix is to define it at the workflow root so it applies to all jobs (current and future unless overridden), usingcontents: readas the minimal baseline recommended by CodeQL.In
.github/workflows/cb-service-container.yml, insert:directly after the trigger section (
on:block) and beforejobs:.No imports, methods, or dependencies are needed.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.