Skip to content

fix: escape HTML special characters in build.sh to prevent HTML injection#1222

Open
pranitaurlam wants to merge 1 commit into
graphql:mainfrom
pranitaurlam:fix/html-injection-build-sh
Open

fix: escape HTML special characters in build.sh to prevent HTML injection#1222
pranitaurlam wants to merge 1 commit into
graphql:mainfrom
pranitaurlam:fix/html-injection-build-sh

Conversation

@pranitaurlam

Copy link
Copy Markdown

Summary

  • Adds html_escape() function to sanitize &, <, >, and " characters before interpolating git-derived data into public/index.html
  • Applies escaping to $GITTAG, $TAGTITLE, and $GITDATE used in HTML table rows
  • Fixes unquoted echo $HTMLecho "$HTML" to prevent word splitting

Closes #1220 in graphql/graphql-spec

Test plan

  • Verify build.sh runs successfully on current repo
  • Verify that a git tag containing <script> would be escaped to &lt;script&gt; in the output HTML
  • Verify that a commit date with & would be rendered as &amp; in the output HTML

🤖 Generated with Claude Code

…tion

Add html_escape() function to sanitize git tag names, tag titles, and
commit dates before interpolating them into public/index.html. Also fix
unquoted echo to prevent word splitting.

Closes graphql#1220

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify

netlify Bot commented Apr 7, 2026

Copy link
Copy Markdown

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit ce5b6fe
🔍 Latest deploy log https://app.netlify.com/projects/graphql-spec-draft/deploys/69d510d6c7a170000828ede3
😎 Deploy Preview https://deploy-preview-1222--graphql-spec-draft.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 7, 2026

Copy link
Copy Markdown

CLA Not Signed

@benjie benjie added the 🐝 Process Related to Governance, Tools, or other meta work label May 25, 2026
@benjie

benjie commented May 25, 2026

Copy link
Copy Markdown
Member

Hi @pranitaurlam; thanks for raising this PR but we can't review or incorporate it until you've signed the CLA. Let us know if you need any assistance.

@benjie benjie added the 💤 stale ? This issue/PR has not been updated in more than 1 year and is not actionable anymore. label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐝 Process Related to Governance, Tools, or other meta work 💤 stale ? This issue/PR has not been updated in more than 1 year and is not actionable anymore.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve HTML generation robustness in build.sh

2 participants