Potential fix for code scanning alert no. 11: Incomplete string escaping or encoding#1627
Merged
Potential fix for code scanning alert no. 11: Incomplete string escaping or encoding#1627
Conversation
Bumps the npm_and_yarn group with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). Updates `vite` from 6.3.3 to 6.3.4 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v6.3.4/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 6.3.4 dependency-type: direct:development dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com>
…d_yarn-de653eece3 (npm): Bump vite from 6.3.3 to 6.3.4 in the npm_and_yarn group
Bumps the eslint group with 1 update: [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest). Updates `@vitest/eslint-plugin` from 1.1.43 to 1.1.44 - [Release notes](https://github.com/vitest-dev/eslint-plugin-vitest/releases) - [Commits](vitest-dev/eslint-plugin-vitest@v1.1.43...v1.1.44) --- updated-dependencies: - dependency-name: "@vitest/eslint-plugin" dependency-version: 1.1.44 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: eslint ... Signed-off-by: dependabot[bot] <support@github.com>
…-352a26273c (npm): Bump @vitest/eslint-plugin from 1.1.43 to 1.1.44 in the eslint group
Bumps the eslint group with 3 updates: [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js), [eslint](https://github.com/eslint/eslint) and [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier). Updates `@eslint/js` from 9.25.1 to 9.26.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/commits/v9.26.0/packages/js) Updates `eslint` from 9.25.1 to 9.26.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v9.25.1...v9.26.0) Updates `eslint-plugin-prettier` from 5.2.6 to 5.3.1 - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases) - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md) - [Commits](prettier/eslint-plugin-prettier@v5.2.6...v5.3.1) --- updated-dependencies: - dependency-name: "@eslint/js" dependency-version: 9.26.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: eslint dependency-version: 9.26.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: eslint-plugin-prettier dependency-version: 5.3.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] <support@github.com>
…-7461966321 (npm): Bump the eslint group with 3 updates
Bumps [npm-run-all2](https://github.com/bcomnes/npm-run-all2) from 7.0.2 to 8.0.1. - [Release notes](https://github.com/bcomnes/npm-run-all2/releases) - [Changelog](https://github.com/bcomnes/npm-run-all2/blob/master/CHANGELOG.md) - [Commits](bcomnes/npm-run-all2@v7.0.2...v8.0.1) --- updated-dependencies: - dependency-name: npm-run-all2 dependency-version: 8.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…n-all2-8.0.1 (npm): Bump npm-run-all2 from 7.0.2 to 8.0.1
Bumps the types group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node). Updates `@types/node` from 22.15.3 to 22.15.11 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 22.15.11 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] <support@github.com>
…ffe8e45d1d (npm): Bump @types/node from 22.15.3 to 22.15.11 in the types group
Bumps the vite group with 3 updates: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite), [vite-node](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vite-node) and [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). Updates `vite` from 6.3.4 to 6.3.5 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v6.3.5/packages/vite) Updates `vite-node` from 3.1.2 to 3.1.3 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v3.1.3/packages/vite-node) Updates `vitest` from 3.1.2 to 3.1.3 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v3.1.3/packages/vitest) --- updated-dependencies: - dependency-name: vite dependency-version: 6.3.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: vite - dependency-name: vite-node dependency-version: 3.1.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: vite - dependency-name: vitest dependency-version: 3.1.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: vite ... Signed-off-by: dependabot[bot] <support@github.com>
…a383f4463 (npm): Bump the vite group with 3 updates
Bumps the eslint group with 2 updates: [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint). Updates `eslint-plugin-prettier` from 5.3.1 to 5.4.0 - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases) - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md) - [Commits](prettier/eslint-plugin-prettier@v5.3.1...v5.4.0) Updates `typescript-eslint` from 8.31.1 to 8.32.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.32.0/packages/typescript-eslint) --- updated-dependencies: - dependency-name: eslint-plugin-prettier dependency-version: 5.4.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: typescript-eslint dependency-version: 8.32.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] <support@github.com>
…-62904752a1 (npm): Bump the eslint group with 2 updates
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.5.1 to 15.5.2. - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md) - [Commits](lint-staged/lint-staged@v15.5.1...v15.5.2) --- updated-dependencies: - dependency-name: lint-staged dependency-version: 15.5.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…taged-15.5.2 (npm): Bump lint-staged from 15.5.1 to 15.5.2
Bumps the types group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node). Updates `@types/node` from 22.15.11 to 22.15.14 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 22.15.14 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] <support@github.com>
…cf84af28fb (npm): Bump @types/node from 22.15.11 to 22.15.14 in the types group
Bumps the eslint group with 1 update: [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier). Updates `eslint-config-prettier` from 10.1.2 to 10.1.3 - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](prettier/eslint-config-prettier@v10.1.2...v10.1.3) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-version: 10.1.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: eslint ... Signed-off-by: dependabot[bot] <support@github.com>
…-c9619ea8fd (npm): Bump eslint-config-prettier from 10.1.2 to 10.1.3 in the eslint group
Bumps [globals](https://github.com/sindresorhus/globals) from 16.0.0 to 16.1.0. - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](sindresorhus/globals@v16.0.0...v16.1.0) --- updated-dependencies: - dependency-name: globals dependency-version: 16.1.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…s-16.1.0 (npm): Bump globals from 16.0.0 to 16.1.0
Bumps the types group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node). Updates `@types/node` from 22.15.14 to 22.15.16 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 22.15.16 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] <support@github.com>
…14e47470f5 (npm): Bump @types/node from 22.15.14 to 22.15.16 in the types group
Bumps the types group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node). Updates `@types/node` from 22.15.16 to 22.15.17 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 22.15.17 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] <support@github.com>
…f9d0c73cc8 (npm): Bump @types/node from 22.15.16 to 22.15.17 in the types group
Bumps the eslint group with 1 update: [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier). Updates `eslint-config-prettier` from 10.1.3 to 10.1.5 - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](prettier/eslint-config-prettier@v10.1.3...v10.1.5) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-version: 10.1.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: eslint ... Signed-off-by: dependabot[bot] <support@github.com>
…-9a630e1a01 (npm): Bump eslint-config-prettier from 10.1.3 to 10.1.5 in the eslint group
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.5.2 to 16.0.0. - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md) - [Commits](lint-staged/lint-staged@v15.5.2...v16.0.0) --- updated-dependencies: - dependency-name: lint-staged dependency-version: 16.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…taged-16.0.0 (npm): Bump lint-staged from 15.5.2 to 16.0.0
…-6b36f9e9f3 (npm): Bump the eslint group with 3 updates
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 16.1.0 to 16.1.1. - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md) - [Commits](lint-staged/lint-staged@v16.1.0...v16.1.1) --- updated-dependencies: - dependency-name: lint-staged dependency-version: 16.1.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…taged-16.1.1 (npm): Bump lint-staged from 16.1.0 to 16.1.1
Bumps the types group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node). Updates `@types/node` from 24.0.1 to 24.0.3 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 24.0.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] <support@github.com>
…f7bf1d1c76 (npm): Bump @types/node from 24.0.1 to 24.0.3 in the types group
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 16.1.1 to 16.1.2. - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md) - [Commits](lint-staged/lint-staged@v16.1.1...v16.1.2) --- updated-dependencies: - dependency-name: lint-staged dependency-version: 16.1.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…taged-16.1.2 (npm): Bump lint-staged from 16.1.1 to 16.1.2
Bumps the eslint group with 3 updates: [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest), [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint). Updates `@vitest/eslint-plugin` from 1.2.5 to 1.2.7 - [Release notes](https://github.com/vitest-dev/eslint-plugin-vitest/releases) - [Commits](vitest-dev/eslint-plugin-vitest@v1.2.5...v1.2.7) Updates `eslint-plugin-prettier` from 5.4.1 to 5.5.0 - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases) - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md) - [Commits](prettier/eslint-plugin-prettier@v5.4.1...v5.5.0) Updates `typescript-eslint` from 8.34.0 to 8.34.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.34.1/packages/typescript-eslint) --- updated-dependencies: - dependency-name: "@vitest/eslint-plugin" dependency-version: 1.2.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: eslint - dependency-name: eslint-plugin-prettier dependency-version: 5.5.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: typescript-eslint dependency-version: 8.34.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: eslint ... Signed-off-by: dependabot[bot] <support@github.com>
…-72fc61b774 (npm): Bump the eslint group with 3 updates
…ing or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
d4f16ca to
d193fe5
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR addresses code scanning alert no. 11 by updating the Windows command argument escaping logic. The changes ensure that backslashes are escaped before double quotes in the ArgumentsBuilder, and the unit tests have been updated to reflect this new behavior.
- Updated the escape logic in src/tools/common/arguments-builder.ts to handle backslashes.
- Updated tests in src/tests/tools/common/arguments-builder.spec.ts to match the new escaping behavior.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tools/common/arguments-builder.ts | Updated the escape logic for Windows by adding a replace call to handle backslashes. |
| src/tests/tools/common/arguments-builder.spec.ts | Updated expected output strings to reflect the additional backslash escapes. |
Member
Author
|
@Mergifyio rebase |
Contributor
❌ Base branch update has failedDetailsGit reported the following error: |
Member
Author
|
@Mergifyio rebase |
Contributor
☑️ Nothing to do, the required conditions are not metDetails
|
Contributor
|
Thank you @arturcic for your contribution! |
arturcic
added a commit
to arturcic/gittools-actions
that referenced
this pull request
Jun 18, 2025
Potential fix for code scanning alert no. 11: Incomplete string escaping or encoding
Contributor
|
🎉 This issue has been resolved in version v4.0.0 🎉 Your GitReleaseManager bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/GitTools/actions/security/code-scanning/11
To fix the issue, the
escapeArgumentmethod should be updated to escape backslashes (\) in addition to double quotes when running on Windows. This can be achieved by modifying thereplacecall to handle both backslashes and double quotes. Specifically, backslashes should be escaped first to avoid interference with escaping double quotes.The fix involves:
value.replacecall on line 92 to escape backslashes (\) before escaping double quotes (").g) to ensure all occurrences are replaced.No new dependencies are required for this fix.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.