Skip to content

Conversation

@lukidzi
Copy link
Contributor

@lukidzi lukidzi commented Dec 17, 2025

Motivation

This PR fixes a command injection vulnerability in the test framework's token generation methods. User-provided data (mesh names, service names, workload names, zone names, and scope values) was being embedded in shell command strings without proper escaping of single quotes.

Implementation information

Fixed four methods in test/framework/universal_controlplane.go:

  • GenerateDpToken: Escapes single quotes in mesh, service, and workload names
  • GenerateZoneIngressToken: Escapes single quotes in zone names
  • GenerateZoneEgressToken: Escapes single quotes in zone names
  • GenerateZoneToken: Escapes single quotes in zone names and scope arrays

Properly escape single quotes in user-provided data (mesh, service,
workload, zone names) before passing to shell commands to prevent
command injection vulnerabilities.

The test framework's token generation methods now escape single quotes
using the shell-safe sequence '\'' to prevent breaking out of quoted
strings in curl commands.

Signed-off-by: Lukasz Dziedziak <[email protected]>
@lukidzi lukidzi requested a review from a team as a code owner December 17, 2025 15:10
@lukidzi lukidzi requested review from lobkovilya and slonka December 17, 2025 15:10
@github-actions
Copy link
Contributor

Reviewer Checklist

🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
If something doesn't apply please check the box and add a justification if the reason is non obvious.

  • Is the PR title satisfactory? Is this part of a larger feature and should be grouped using > Changelog?
  • PR description is clear and complete. It Links to relevant issue as well as docs and UI issues
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as an image registry)
  • IPv6 is taken into account (.e.g: no string concatenation of host port)
  • Tests (Unit test, E2E tests, manual test on universal and k8s)
    • Don't forget ci/ labels to run additional/fewer tests
  • Does this contain a change that needs to be notified to users? In this case, UPGRADE.md should be updated.
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label)

@lukidzi lukidzi changed the title fix(test): escape shell special characters in token generation test(e2e): escape shell special characters in token generation Dec 17, 2025
@slonka slonka merged commit 2ff74f6 into kumahq:master Jan 7, 2026
15 of 17 checks passed
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.

2 participants