Title: Add Lint rule to flag `RegExp` usage · Issue #9960 · getsentry/sentry-javascript · GitHub
Open Graph Title: Add Lint rule to flag `RegExp` usage · Issue #9960 · getsentry/sentry-javascript
X Title: Add Lint rule to flag `RegExp` usage · Issue #9960 · getsentry/sentry-javascript
Description: Problem Statement We've had incidents in the past with dynamically constructing regular expressions based on user input. fictional example: new RegExp(`\/${paramValue}\/`) Solution Brainstorm Since this is highly problematic in certain s...
Open Graph Description: Problem Statement We've had incidents in the past with dynamically constructing regular expressions based on user input. fictional example: new RegExp(`\/${paramValue}\/`) Solution Brainstorm Since...
X Description: Problem Statement We've had incidents in the past with dynamically constructing regular expressions based on user input. fictional example: new RegExp(`\/${paramValue}\/`) Solution Brainstorm S...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/9960
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add Lint rule to flag `RegExp` usage","articleBody":"### Problem Statement\n\nWe've had incidents in the past with dynamically constructing regular expressions based on user input.\r\n\r\nfictional example:\r\n\r\n```js\r\nnew RegExp(`\\/${paramValue}\\/`)\r\n``` \r\n\r\n\n\n### Solution Brainstorm\n\nSince this is highly problematic in certain situations, we should add a lint rule that flags usage of dynamically created regular expressions. In many situations, it's totally fine to opt-out/ignore this rule if the `RegExp` usage is safe but it's better to have a mechanism in place that explicitly and automatically reminds us of being extra careful.\r\n\r\nOut of scope/already covered:\r\n- Analysis of \"static\" regular expressions like `/some(regex)?/`. We have CodeQL in CI which already checks for ReDoS susceptible expressions in each PR\r\n\r\nAlternative: There's a CodeQL rule that we currently haven't enabled that more aggressively checks for `RegExp` usage. In this case we could also enable this rule instead of adding a lint rule.\r\n\r\nThis is an action item from INC-585. @anonrig will investigate applicable rules we'll discuss/evaluate them afterwards.","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2023-12-21T15:56:31Z","url":"https://github.com/getsentry/sentry-javascript/issues/9960"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3be956e3-8178-8e9e-fb47-4ea7f09054ac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2C4:1FA32B:F8E87:15AA3E:6B046413 |
| html-safe-nonce | aa7c25c91490deb80ee7563238501641e8ce0698b9b0daf79607011d17f75c9c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkM0OjFGQTMyQjpGOEU4NzoxNUFBM0U6NkIwNDY0MTMiLCJ2aXNpdG9yX2lkIjoiOTA3MDQ3OTYwMzg2ODY1NjY1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 479a4d7348a631450aafaea03cc185cbf2bbb6fe570384090295bde84f4ae391 |
| hovercard-subject-tag | issue:2052681855 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/9960/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e6654858440d6445f94525990cc668f3c6f6cbf84e8e83c3fddd9e0cb88766a3/getsentry/sentry-javascript/issues/9960 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e6654858440d6445f94525990cc668f3c6f6cbf84e8e83c3fddd9e0cb88766a3/getsentry/sentry-javascript/issues/9960 |
| og:image:alt | Problem Statement We've had incidents in the past with dynamically constructing regular expressions based on user input. fictional example: new RegExp(`\/${paramValue}\/`) Solution Brainstorm Since... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lms24 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width