-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Console] Fix double escaping issue from code scan #194938
[Console] Fix double escaping issue from code scan #194938
Conversation
Pinging @elastic/kibana-management (Team:Kibana Management) |
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: cc @sabarasaba |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this @sabarasaba! Changes lgtm, tested locally,
Starting backport for target branches: 7.17, 8.15, 8.x https://github.com/elastic/kibana/actions/runs/11190894174 |
(cherry picked from commit c51f850)
(cherry picked from commit c51f850)
(cherry picked from commit c51f850)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…195164) # Backport This will backport the following commits from `main` to `8.15`: - [[Console] Fix double escaping issue from code scan (#194938)](#194938) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ignacio Rivas","email":"rivasign@gmail.com"},"sourceCommit":{"committedDate":"2024-10-05T05:52:18Z","message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana Management","release_note:skip","v9.0.0","backport:all-open"],"title":"[Console] Fix double escaping issue from code scan","number":194938,"url":"https://github.com/elastic/kibana/pull/194938","mergeCommit":{"message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194938","number":194938,"mergeCommit":{"message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3"}}]}] BACKPORT--> Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
…195165) # Backport This will backport the following commits from `main` to `8.x`: - [[Console] Fix double escaping issue from code scan (#194938)](#194938) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ignacio Rivas","email":"rivasign@gmail.com"},"sourceCommit":{"committedDate":"2024-10-05T05:52:18Z","message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana Management","release_note:skip","v9.0.0","backport:all-open"],"title":"[Console] Fix double escaping issue from code scan","number":194938,"url":"https://github.com/elastic/kibana/pull/194938","mergeCommit":{"message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194938","number":194938,"mergeCommit":{"message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3"}}]}] BACKPORT--> Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
…195163) # Backport This will backport the following commits from `main` to `7.17`: - [[Console] Fix double escaping issue from code scan (#194938)](#194938) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ignacio Rivas","email":"rivasign@gmail.com"},"sourceCommit":{"committedDate":"2024-10-05T05:52:18Z","message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana Management","release_note:skip","v9.0.0","backport:all-open"],"title":"[Console] Fix double escaping issue from code scan","number":194938,"url":"https://github.com/elastic/kibana/pull/194938","mergeCommit":{"message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194938","number":194938,"mergeCommit":{"message":"[Console] Fix double escaping issue from code scan (#194938)","sha":"c51f8506aad1e0707591549faaf81ad9af8b42e3"}}]}] BACKPORT--> Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
Fixes https://github.com/elastic/kibana/security/code-scanning/53
Summary
To fix the problem, we need to ensure that the unescape function correctly handles the unescaping process without causing double unescaping. The best way to achieve this is to unescape the backslash last, ensuring that any escaped characters are correctly processed before handling the escape character itself.
In order to test this: run
GET /.kibana_ingest
in console and make sure that the warning header is shown correctly in the output panel.