Skip to content

Conversation

@ajay-dhangar
Copy link
Member

Potential fix for https://github.com/codeharborhub/codeharborhub.github.io/security/code-scanning/1819

To fix the problem, we should follow the recommended pattern: bind the untrusted value (github.event.issue.body) to an environment variable using workflow expression syntax, and then access it inside the shell using native shell variable expansion (e.g. $ISSUE_BODY) instead of ${{ ... }}. This prevents the untrusted content from being parsed as part of the shell script itself.

The best minimal fix without changing functionality is to modify the Validate Issue Content step so that:

  • It introduces an env: section mapping ISSUE_BODY: ${{ github.event.issue.body }}.
  • The run: script reads this environment variable using shell syntax, e.g. issue_body="$ISSUE_BODY" or directly uses $ISSUE_BODY in the condition.
  • It no longer embeds ${{ github.event.issue.body }} inside the run: script.

Concretely, in .github/workflows/issue_creation_workflow.yml, lines 34–41 should be updated. We add an env: block to the Validate Issue Content step and replace issue_body="${{ github.event.issue.body }}" with issue_body="$ISSUE_BODY". No new imports or external dependencies are required; this is purely a YAML/Actions configuration change.

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 26, 2025 04: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!

@deepsource-io
Copy link
Contributor

deepsource-io bot commented Dec 26, 2025

Here's the code health analysis summary for commits 73b7fe2..08c5f62. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@github-actions
Copy link

⚡️ Lighthouse Report for the Deploy Preview of this PR 🚀

🔗 Site: CodeHarborHub | Live Site

URL 🌐 Performance Accessibility Best Practices SEO 📊
/ 🔴 29 🟡 77 🟡 75 🟢 100 📄
/docs 🔴 48 🟡 89 🟡 75 🟢 100 📄
/courses 🟡 51 🟡 88 🟢 96 🟢 100 📄
/showcase 🔴 47 🟡 87 🟡 75 🟡 86 📄
/community 🟡 51 🟡 88 🟢 96 🟢 100 📄

@ajay-dhangar ajay-dhangar merged commit 19a58fc into main Dec 26, 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