-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Incomplete string escaping or encoding #212847
Merged
Merged
Conversation
This file contains 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
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Pinging @elastic/security-scalability (Team:Security-Scalability) |
haetamoudi
approved these changes
Mar 4, 2025
Starting backport for target branches: 8.18, 8.x, 9.0 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 4, 2025
Fix for [https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546) To fix the problem, we need to ensure that backslashes are also escaped in the `trim_key` and `trim_value` properties of the `kvInput` object. This can be done by adding an additional replace call to escape backslashes before escaping single and double quotes. The best way to fix this without changing existing functionality is to use a regular expression with the `g` flag to replace all occurrences of backslashes with double backslashes. Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> (cherry picked from commit 8970b99)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 4, 2025
Fix for [https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546) To fix the problem, we need to ensure that backslashes are also escaped in the `trim_key` and `trim_value` properties of the `kvInput` object. This can be done by adding an additional replace call to escape backslashes before escaping single and double quotes. The best way to fix this without changing existing functionality is to use a regular expression with the `g` flag to replace all occurrences of backslashes with double backslashes. Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> (cherry picked from commit 8970b99)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 4, 2025
Fix for [https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546) To fix the problem, we need to ensure that backslashes are also escaped in the `trim_key` and `trim_value` properties of the `kvInput` object. This can be done by adding an additional replace call to escape backslashes before escaping single and double quotes. The best way to fix this without changing existing functionality is to use a regular expression with the `g` flag to replace all occurrences of backslashes with double backslashes. Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> (cherry picked from commit 8970b99)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Mar 4, 2025
# Backport This will backport the following commits from `main` to `8.x`: - [Fix Incomplete string escaping or encoding (#212847)](#212847) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bharat Pasupula","email":"123897612+bhapas@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-04T12:05:05Z","message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Team:Security-Scalability","backport:version","Feature:AutomaticImport","v9.1.0","v8.19.0","v8.18.1"],"title":"Fix Incomplete string escaping or encoding","number":212847,"url":"https://github.com/elastic/kibana/pull/212847","mergeCommit":{"message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212847","number":212847,"mergeCommit":{"message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Bharat Pasupula <123897612+bhapas@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Mar 4, 2025
# Backport This will backport the following commits from `main` to `9.0`: - [Fix Incomplete string escaping or encoding (#212847)](#212847) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bharat Pasupula","email":"123897612+bhapas@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-04T12:05:05Z","message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Team:Security-Scalability","backport:version","Feature:AutomaticImport","v9.1.0","v8.19.0","v8.18.1"],"title":"Fix Incomplete string escaping or encoding","number":212847,"url":"https://github.com/elastic/kibana/pull/212847","mergeCommit":{"message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212847","number":212847,"mergeCommit":{"message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Bharat Pasupula <123897612+bhapas@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Mar 4, 2025
# Backport This will backport the following commits from `main` to `8.18`: - [Fix Incomplete string escaping or encoding (#212847)](#212847) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bharat Pasupula","email":"123897612+bhapas@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-04T12:05:05Z","message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Team:Security-Scalability","backport:version","Feature:AutomaticImport","v9.1.0","v8.19.0","v8.18.1"],"title":"Fix Incomplete string escaping or encoding","number":212847,"url":"https://github.com/elastic/kibana/pull/212847","mergeCommit":{"message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212847","number":212847,"mergeCommit":{"message":"Fix Incomplete string escaping or encoding (#212847)\n\nFix for\n[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)\n\nTo fix the problem, we need to ensure that backslashes are also escaped\nin the `trim_key` and `trim_value` properties of the `kvInput` object.\nThis can be done by adding an additional replace call to escape\nbackslashes before escaping single and double quotes. The best way to\nfix this without changing existing functionality is to use a regular\nexpression with the `g` flag to replace all occurrences of backslashes\nwith double backslashes.\n\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>","sha":"8970b99d4fa0f411f5896bc426806571119eff2c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Bharat Pasupula <123897612+bhapas@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport:prev-minor
Backport to (9.0) the previous minor version (i.e. one version back from main)
backport:version
Backport to applied version labels
Feature:AutomaticImport
release_note:skip
Skip the PR/issue when compiling release notes
Team:Security-Scalability
Team label for Security Integrations Scalability Team
v8.18.0
v8.18.1
v8.19.0
v9.0.0
v9.1.0
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.
Fix for https://github.com/elastic/kibana/security/code-scanning/546
To fix the problem, we need to ensure that backslashes are also escaped in the
trim_key
andtrim_value
properties of thekvInput
object. This can be done by adding an additional replace call to escape backslashes before escaping single and double quotes. The best way to fix this without changing existing functionality is to use a regular expression with theg
flag to replace all occurrences of backslashes with double backslashes.