microcks-cli icon indicating copy to clipboard operation
microcks-cli copied to clipboard

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

Open rubrx opened this issue 7 months ago • 2 comments

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 avatar May 04 '26 12:05 rubrx

👋 @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!

github-actions[bot] avatar May 04 '26 12:05 github-actions[bot]

This pull request has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Jun 04 '26 01:06 github-actions[bot]