Skip to content

fix: use json.Marshal in CreateResult instead of string concatenation#274

Open
rubrx wants to merge 1 commit intomicrocks:masterfrom
rubrx:fix/create-test-result-json-marshal
Open

fix: use json.Marshal in CreateResult instead of string concatenation#274
rubrx wants to merge 1 commit intomicrocks:masterfrom
rubrx:fix/create-test-result-json-marshal

Conversation

@rubrx
Copy link
Copy Markdown

@rubrx rubrx commented May 4, 2026

CreateTestResult was building JSON with string concatenation, which could break or allow injection if inputs had quotes/backslashes.

Switched to a typed struct + json.Marshal for safe escaping, and properly unmarshaled filteredOperations, operationsHeaders, and oAuth2Context before combining...

Tests:

  1. Malicious input test to ensure no field injection
  2. Verify secretName is omitted when empty (omitempty)

fixes #266

@rubrx rubrx requested review from Harsh4902, lbroudoux and yada as code owners May 4, 2026 12:29
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

👋 @rubrx

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

Signed-off-by: Krie <112789870+R-Kri@users.noreply.github.com>
@rubrx rubrx force-pushed the fix/create-test-result-json-marshal branch from 412502e to 27738af Compare May 4, 2026 12:33
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.

fix: use json.Marshal in CreateTestResult instead of string concatenation

1 participant