-
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
[Console] Fix code scanning alert #194700
[Console] Fix code scanning alert #194700
Conversation
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
To update your PR or re-run it, just comment with: cc @sabarasaba |
Pinging @elastic/kibana-management (Team:Kibana Management) |
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.
Changes lgtm!
Starting backport for target branches: 8.x |
(cherry picked from commit 3dbb7da)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[Console] Fix code scanning alert (#194700)](#194700) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ignacio Rivas","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-03T13:21:52Z","message":"[Console] Fix code scanning alert (#194700)","sha":"3dbb7da016a42f846b04d0f88a9fba746238558d","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:prev-minor"],"title":"[Console] Fix code scanning alert ","number":194700,"url":"https://github.com/elastic/kibana/pull/194700","mergeCommit":{"message":"[Console] Fix code scanning alert (#194700)","sha":"3dbb7da016a42f846b04d0f88a9fba746238558d"}},"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/194700","number":194700,"mergeCommit":{"message":"[Console] Fix code scanning alert (#194700)","sha":"3dbb7da016a42f846b04d0f88a9fba746238558d"}}]}] BACKPORT--> Co-authored-by: Ignacio Rivas <[email protected]>
Fixes https://github.com/elastic/kibana/security/code-scanning/16 and https://github.com/elastic/kibana/security/code-scanning/15
Summary
Replaced the regex for the
hasComments
method for another one that avoids overmatching by ensuring that the block comment starts with /, contains any number of non- characters, followed by one or more stars, and checks for a proper closing */.Note: This code isnt used anyway as it's only used by the old console model for the sense editor which should be eventually deleted with #194533