Title: Quadratic regex in readline.js · Issue #26596 · nodejs/node · GitHub
Open Graph Title: Quadratic regex in readline.js · Issue #26596 · nodejs/node
X Title: Quadratic regex in readline.js · Issue #26596 · nodejs/node
Description: Version: master branch Subsystem: readline lib/readline.js contains this code snippet: Interface.prototype._wordLeft = function() { if (this.cursor > 0) { var leading = this.line.slice(0, this.cursor); var match = leading.match(/(?:[^\w\...
Open Graph Description: Version: master branch Subsystem: readline lib/readline.js contains this code snippet: Interface.prototype._wordLeft = function() { if (this.cursor > 0) { var leading = this.line.slice(0, this.curs...
X Description: Version: master branch Subsystem: readline lib/readline.js contains this code snippet: Interface.prototype._wordLeft = function() { if (this.cursor > 0) { var leading = this.line.slice(0, this.c...
Opengraph URL: https://github.com/nodejs/node/issues/26596
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Quadratic regex in readline.js","articleBody":"Version: master branch\r\nSubsystem: readline\r\n\r\n`lib/readline.js` contains this code snippet:\r\n\r\n```\r\nInterface.prototype._wordLeft = function() {\r\n if (this.cursor \u003e 0) { \r\n var leading = this.line.slice(0, this.cursor);\r\n var match = leading.match(/(?:[^\\w\\s]+|\\w+|)\\s*$/);\r\n this._moveCursor(-match[0].length);\r\n }\r\n};\r\n```\r\n\r\nThis regex is quadratic: `/(?:[^\\w\\s]+|\\w+|)\\s*$/`.\r\n\r\nI would be shocked if this were a viable ReDoS vector (hence the public bug report), but if `this.line` can be long (100K chars?) then it might present a performance problem.\r\n\r\nI have not investigated reachability/triggerability nor the use cases of readline.","author":{"url":"https://github.com/davisjam","@type":"Person","name":"davisjam"},"datePublished":"2019-03-11T18:18:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/26596/node/issues/26596"}
| 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:b8b2f6f5-6f93-10b0-3a34-e958f1ab58ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9E8:3463DE:41D02D6:5D219AE:6A4FB637 |
| html-safe-nonce | ecf5c0b9360beaaaa5d62876b40c0c5126f6be9c13f2aef6b2ec19aa5a9d9ce8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUU4OjM0NjNERTo0MUQwMkQ2OjVEMjE5QUU6NkE0RkI2MzciLCJ2aXNpdG9yX2lkIjoiNzI4Mzc1MDAzNzM3MjI1Mzc1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bd9e1973d7e9b83a942578eace2cbda20670f50672632eaf4d20d6d509b75558 |
| hovercard-subject-tag | issue:419615419 |
| 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/nodejs/node/26596/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bbee034f145a804ab6e4934252711b93b08805e22df643e35b75692603c1759d/nodejs/node/issues/26596 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bbee034f145a804ab6e4934252711b93b08805e22df643e35b75692603c1759d/nodejs/node/issues/26596 |
| og:image:alt | Version: master branch Subsystem: readline lib/readline.js contains this code snippet: Interface.prototype._wordLeft = function() { if (this.cursor > 0) { var leading = this.line.slice(0, this.curs... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davisjam |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| 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 | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width