Skip to content

Potential fix for code scanning alert no. 2: Reflected cross-site scripting - #16

Merged
winkingturtle-vmw merged 1 commit into
masterfrom
alert-autofix-2
Aug 13, 2026
Merged

Potential fix for code scanning alert no. 2: Reflected cross-site scripting#16
winkingturtle-vmw merged 1 commit into
masterfrom
alert-autofix-2

Conversation

@aramprice

Copy link
Copy Markdown
Member

Potential fix for https://github.com/cloudfoundry/go-fetcher/security/code-scanning/2

Use contextual escaping for HTML attribute values before interpolating data into <meta ... content="..."> strings.

Best fix in this file:

  1. Add the standard library import html.
  2. Escape goImportContent and goSourceContent with html.EscapeString(...) when creating meta tags.
  3. Also escape values used in the refresh meta tag URL (h.config.ImportPrefix, repoPath) before embedding into attribute content.

This preserves behavior (same logical metadata/redirect target) while preventing attribute/context breaking XSS payloads.

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

…ipting

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@aramprice
aramprice marked this pull request as ready for review August 6, 2026 17:06
@aramprice

Copy link
Copy Markdown
Member Author

GitHub workers are currently having issues, which is causing the PR checks to timeout:
=> https://www.githubstatus.com/

@winkingturtle-vmw
winkingturtle-vmw merged commit ca685b6 into master Aug 13, 2026
8 of 11 checks passed
@github-project-automation github-project-automation Bot moved this from Inbox to Done in CF Community Aug 13, 2026
@aramprice
aramprice deleted the alert-autofix-2 branch August 13, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants