Skip to content
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

Conversation

sabarasaba
Copy link
Member

@sabarasaba sabarasaba commented Oct 4, 2024

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.

@sabarasaba sabarasaba added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Oct 4, 2024
@sabarasaba sabarasaba self-assigned this Oct 4, 2024
@sabarasaba sabarasaba marked this pull request as ready for review October 4, 2024 12:09
@sabarasaba sabarasaba requested a review from a team as a code owner October 4, 2024 12:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @sabarasaba

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a 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,

@sabarasaba sabarasaba merged commit c51f850 into elastic:main Oct 5, 2024
27 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 7.17, 8.15, 8.x

https://github.com/elastic/kibana/actions/runs/11190894174

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 5, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 5, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 5, 2024
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
7.17
8.15
8.x

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 Oct 5, 2024
…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>
kibanamachine added a commit that referenced this pull request Oct 5, 2024
…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>
kibanamachine added a commit that referenced this pull request Oct 5, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release Feature:Console Dev Tools Console Feature release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.17.25 v8.15.3 v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants