Skip to content

Potential fix for code scanning alert no. 265: Environment variable built from user-controlled sources - #47600

Closed
tarekziade wants to merge 1 commit into
mainfrom
alert-autofix-265
Closed

tarekziade wants to merge 1 commit into
mainfrom
alert-autofix-265

Conversation

@tarekziade

@tarekziade tarekziade commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

CI

Potential fix for https://github.com/huggingface/transformers/security/code-scanning/265

Use GitHub Actions’ multiline env-file format with a unique delimiter instead of KEY=VALUE when assigning a value derived from runtime data. This prevents newline/env-injection because the value is bounded by explicit delimiter markers, not parsed as extra KEY=VALUE lines.

Best minimal fix (no functionality change):

  • In .github/workflows/check_failed_tests.yml, update the Get \END_SHA` from previous CI runs of the same workflow step (run:` block around lines 203–204).
  • Capture Python output into a shell variable, generate a unique delimiter (e.g., uuidgen), and append:
    • END_SHA<<$DELIM
    • actual value
    • $DELIM
      to $GITHUB_ENV.

No new imports/dependencies are required; this is shell-only.

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

…uilt from user-controlled sources

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@tarekziade
tarekziade requested a review from paulinebm July 28, 2026 08:31
@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 30342698340
Result: success | Grafana metrics are not available yet.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ArthurZucker

Copy link
Copy Markdown
Collaborator

Closing: the workflow hardening in #49059 (and #49046) addressed these code-scanning alerts in check_failed_tests.yml.

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.

3 participants