Skip to content

chore: Harden workflow against command injection in PR title validation#18771

Merged
yihua merged 3 commits into
apache:masterfrom
cyber841:master
May 18, 2026
Merged

chore: Harden workflow against command injection in PR title validation#18771
yihua merged 3 commits into
apache:masterfrom
cyber841:master

Conversation

@cyber841
Copy link
Copy Markdown
Contributor

@cyber841 cyber841 commented May 18, 2026

Describe the issue this Pull Request addresses

Hi Apache Hudi Team,

As requested and suggested by Piotr P. Karwasz from the Apache Security Team, I am submitting this pull request to apply a security hardening improvement to the pr_title_validation.yml workflow.

Summary and Changelog

  • Mapped the user-controlled github.event.pull_request.title context variable into an environment variable (env: PR_TITLE).
  • Updated the inline shell script to reference the environment variable $PR_TITLE instead of direct inline expansion.

This protects the project's CI/CD runner environment from potential arbitrary command execution (Command Injection) through crafted PR titles if trigger types or job permissions are ever modified in the future.

Best regards,
Rasul Rasulzada

Impact

Security fix

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

@github-actions github-actions Bot added the size:S PR with lines of changes in (10, 100] label May 18, 2026
Copy link
Copy Markdown
Contributor

@hudi-agent hudi-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

No reviewable code files in this PR.

cc @yihua

@yihua yihua changed the title Harden workflow against command injection in PR title validation chore: Harden workflow against command injection in PR title validation May 18, 2026
Copy link
Copy Markdown
Contributor

@yihua yihua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix @cyber841

@hudi-bot
Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@github-actions github-actions Bot added size:XS PR with lines of changes in <= 10 and removed size:S PR with lines of changes in (10, 100] labels May 18, 2026
@yihua yihua merged commit 0983c0d into apache:master May 18, 2026
62 of 63 checks passed
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.16%. Comparing base (db46081) to head (ae0dc0d).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18771   +/-   ##
=========================================
  Coverage     68.16%   68.16%           
- Complexity    29156    29157    +1     
=========================================
  Files          2521     2521           
  Lines        141371   141371           
  Branches      17549    17549           
=========================================
+ Hits          96359    96368    +9     
+ Misses        37081    37071   -10     
- Partials       7931     7932    +1     
Flag Coverage Δ
common-and-other-modules 44.44% <ø> (+<0.01%) ⬆️
hadoop-mr-java-client 44.98% <ø> (-0.01%) ⬇️
spark-client-hadoop-common 48.31% <ø> (-0.01%) ⬇️
spark-java-tests 48.95% <ø> (+<0.01%) ⬆️
spark-scala-tests 44.85% <ø> (+<0.01%) ⬆️
utilities 37.56% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

yihua added a commit that referenced this pull request May 20, 2026
…on (#18771)

Co-authored-by: Y Ethan Guo <ethan.guoyihua@gmail.com>
dwshmilyss pushed a commit to dwshmilyss/hudi that referenced this pull request May 21, 2026
…on (apache#18771)

Co-authored-by: Y Ethan Guo <ethan.guoyihua@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS PR with lines of changes in <= 10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants