Skip to content

SQSCANGHA-101 Add more input injection tests#200

Merged
aleksandra-bozhinoska-sonarsource merged 2 commits intomasterfrom
task/abozhinoska/SQSCANGHA-101/add-input-injection-tests
Aug 28, 2025
Merged

SQSCANGHA-101 Add more input injection tests#200
aleksandra-bozhinoska-sonarsource merged 2 commits intomasterfrom
task/abozhinoska/SQSCANGHA-101/add-input-injection-tests

Conversation

@aleksandra-bozhinoska-sonarsource
Copy link
Contributor

@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource commented Aug 21, 2025

SQSCANGHA-101

Please be aware that we are not actively looking for feature contributions. The truth is that it's extremely difficult for someone outside SonarSource to comply with our roadmap and expectations. Therefore, we typically only accept minor cosmetic changes and typo fixes. If you would like to see a new feature, please create a new thread in the forum "Suggest new features".

With that in mind, if you would like to submit a code contribution, make sure that you adhere to the following guidelines and all tests are passing:

  • Please explain your motives to contribute this change: what problem you are trying to fix, what improvement you are trying to make
  • Make sure any code you changed is covered by tests
  • If there is a JIRA ticket available, please make your commits and pull request start with the ticket ID (SONAR-XXXX)

We will try to give you feedback on your contribution as quickly as possible.

Thank You!
The SonarSource Team

@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource force-pushed the task/abozhinoska/SQSCANGHA-101/add-input-injection-tests branch 8 times, most recently from ae5237d to 03037ab Compare August 22, 2025 08:14
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource force-pushed the task/abozhinoska/SQSCANGHA-101/add-input-injection-tests branch 4 times, most recently from 21d1af5 to 28a1a1a Compare August 27, 2025 11:45
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource changed the title SQSCANGHA-101 Add another test SQSCANGHA-101 Add more input injection tests Aug 27, 2025
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource force-pushed the task/abozhinoska/SQSCANGHA-101/add-input-injection-tests branch from 28a1a1a to 940c3a5 Compare August 27, 2025 12:55
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource force-pushed the task/abozhinoska/SQSCANGHA-101/add-input-injection-tests branch from 940c3a5 to 67117d0 Compare August 27, 2025 15:17
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource marked this pull request as ready for review August 28, 2025 08:45
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource force-pushed the task/abozhinoska/SQSCANGHA-101/add-input-injection-tests branch from bdd71f8 to a9a17d3 Compare August 28, 2025 08:50
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource merged commit 016cabf into master Aug 28, 2025
70 checks passed
@aleksandra-bozhinoska-sonarsource aleksandra-bozhinoska-sonarsource deleted the task/abozhinoska/SQSCANGHA-101/add-input-injection-tests branch August 28, 2025 08:57
set -euo pipefail

# run the sonar scanner cli
cmd=(${GITHUB_ACTION_PATH}/scripts/run-sonar-scanner-cli.sh "${INPUT_ARGS}")

Choose a reason for hiding this comment

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

@aleksandra-bozhinoska-sonarsource @antoine-vinot-sonarsource
This generates error when used in combination with additional quotes:

ie:
INPUT_ARGS: -Dsonar.projectKey=prefix_$(basename "org/repo") -Dsonar.branch.name=branch -Dsonar.scm.provider=git

It generates the following command:

sonar-scanner '-Dsonar.projectKey=prefix_$(basename' '"org/repo"' ')' -Dsonar.branch.name=branch -Dsonar.scm.provider=git

Error:
11:01:03.882 ERROR Unrecognized option: "org/repo"

@kronenthaler
Copy link

This changes generates errors on the sonar.source/sonar.tests e.g
INPUT_ARGS: -Dsonar.source="Modules/A,Modules/B"

sonar-scanner '-Dsonar.sources="Modules/A,Modules/B"'

Produces error:
The folder 'Modules/A,Modules/B' does not exist for: <projectkey>

It worked fine in v5.3.0

@aleksandra-bozhinoska-sonarsource
Copy link
Contributor Author

This changes generates errors on the sonar.source/sonar.tests e.g INPUT_ARGS: -Dsonar.source="Modules/A,Modules/B"

sonar-scanner '-Dsonar.sources="Modules/A,Modules/B"'

Produces error: The folder 'Modules/A,Modules/B' does not exist for: <projectkey>

It worked fine in v5.3.0

Hello @kronenthaler, can you try removing the double quotes and pass the arg like -Dsonar.sources=Modules/A,Modules/B? Also, for better visibility, please consider posting on our community if you encounter any further issues.

@kronenthaler
Copy link

Hi @aleksandra-bozhinoska-sonarsource, is there an specific topic in the forum related to this change/issue?

@aleksandra-bozhinoska-sonarsource
Copy link
Contributor Author

Hi @aleksandra-bozhinoska-sonarsource, is there an specific topic in the forum related to this change/issue?

Not that I am aware of @kronenthaler - feel free to open a new one if my suggestion above did not help.

@kronenthaler
Copy link

@aleksandra-bozhinoska-sonarsource Thanks, i have made a report and a sample project. Linked here for cross-reference: https://community.sonarsource.com/t/sonarqube-scan-action-v5-3-1-is-broken/147965

@ericcornelissen
Copy link

Any particular reason the use of ${{ inputs.scannerVersion }} in

run: echo "${RUNNER_TEMP}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }}/bin" >> $GITHUB_PATH

is trusted while ${{ inputs.args }} wasn't and was changed here? I would expect all inputs to be untrusted, hence the above to be fixed too 🤔

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.

5 participants