Skip to content

Potential fix for code scanning alert no. 4: Reflected cross-site scripting - #14

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

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

Conversation

@aramprice

Copy link
Copy Markdown
Member

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

To fix this safely without changing behavior, escape untrusted or potentially untrusted values before inserting them into HTML attribute values. In this function, the cleanest fix is to HTML-escape the final goImportContent and goSourceContent values when building the meta tags.

Best single approach in this file:

  • Add html to imports.
  • On lines constructing goImport and goSource, wrap the content values with html.EscapeString(...).
  • Keep all existing logic, logging, redirects, and response format unchanged except proper escaping in emitted HTML.

This preserves functionality (same metadata semantics) while preventing attribute/context injection via repoName (and any other unexpected characters in composed content).

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 f83f068 into master Aug 13, 2026
7 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-4 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