Skip to content

Conversation

@ajay-dhangar
Copy link
Member

Potential fix for https://github.com/codeharborhub/tutorial/security/code-scanning/2

To fix the problem, we should stop interpolating the untrusted github.event.issue.body directly into the shell script and instead pass it via an environment variable, then read it using native shell syntax ($ISSUE_BODY). This avoids GitHub Actions expression injection in the shell context while preserving existing behavior.

Concretely, in the Check for Security and Trust step (lines 43–49), we will:

  • Add an env: section that sets ISSUE_BODY: ${{ github.event.issue.body }}.
  • Change the script to use issue_body="$ISSUE_BODY" (or just use $ISSUE_BODY directly) instead of issue_body="${{ github.event.issue.body }}".

We will leave the logic of the checks unchanged. No additional imports or external tools are needed, and no other steps in the file are modified.

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

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@ajay-dhangar ajay-dhangar marked this pull request as ready for review December 27, 2025 09:12
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Great job, @ajay-dhangar! 🎉 Thank you for submitting your pull request to CodeHarborHub. We appreciate your contribution and enthusiasm! Our team will review it soon. If you have any questions or need further assistance, feel free to reach out. Thanks for contributing!

@ajay-dhangar ajay-dhangar merged commit ca29c5a into main Dec 27, 2025
5 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