Fix shell interpolation injection vulnerabilities#436
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Welcome to the KubeStellar community! 💖 Thanks and congrats 🎉 for opening your first PR here! We're excited to have you contributing. Before merge, please ensure:
📬 If you're using KubeStellar in your organization, please add your name to our Adopters list. 🙏 It really helps the project gain momentum and credibility — a small contribution back with a big impact. Resources:
A maintainer will review your PR soon. Hope you have a great time here! 🌟 ~~~~~~~~~~ 🌟 📬 If you like KubeStellar, please ⭐ star ⭐ our repo to support it! 🙏 It really helps the project gain momentum and credibility — a small contribution back with a big impact. |
Signed-off-by: thisisvaishanv <vaishnavxwork@gmail.com>
cdeb204 to
34baa89
Compare
Here's the complete PR body, ready to paste:
Description
Fixes a P0 security vulnerability where nine
python3 -cinvocations indashboard/health-check.shanddashboard/api-collector.shinterpolated shell environment variables directly into Python source code strings. If any variable value contained a single quote ('), it would break out of the Python string literal and enable arbitrary code execution.Vulnerable pattern:
python3 -c "import json; wfs=json.loads('${HEALTH_CHECK_WORKFLOWS}'); print(len(wfs))"Safe pattern (this fix):
The variable is now passed through
stdinso Python reads it as plain data it is never part of the executed code string.Related Issue
Fixes #
Identified by Architect scan 2026-05-12 (commit
f1f12aa7d).Changes Made
python3 -c "...${HEALTH_CHECK_WORKFLOWS}..."calls indashboard/health-check.shwith stdin-pipe patternpython3 -c "...json.loads('${HEALTH_PERF_WORKFLOWS}')..."call indashboard/health-check.shwith stdin-pipe patternpython3 -ccall indashboard/health-check.shfor${HEALTH_DEPLOY_JOBS}with stdin-pipe patternpython3 -ccalls indashboard/api-collector.shthat interpolated file paths into Python code — switched tocat file | python3 -c "...json.load(sys.stdin)..."${VAR}insidepython3 -cstrings)Checklist
Screenshots or Logs (if applicable)
Grep check zero vulnerable patterns remaining:
Single-quote smoke tests (all 4 variables):
Canonical exploit payload test:
Additional Notes
HEALTH_CHECK_WORKFLOWS,HEALTH_PERF_WORKFLOWS, andHEALTH_DEPLOY_JOBSare currently sourced from trusted config files, the stdin-pipe pattern eliminates the entire injection surface regardless of data origin#427