Repository navigation
bug: fix ReDoS in todo reminder and import date parsing (sfind-4c4caf56) - #1107
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Upgrade humanize-ms 1.0.1 -> 1.2.1, ms 0.7.3 -> 2.1.3 and moment 2.15.1 ->
2.29.4, and skip reminder parsing, imgRegex matching and import date
formatting for input longer than 1000 characters. Guard the empty period
("... in ") since ms 2.x throws on an empty string.
Refs: sfind-4c4caf5662bf4bfc99fc567c8b99355b
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Author
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Corrige o finding de Code Scan sfind-4c4caf56 (low): ReDoS no parsing de lembrete dos todos e no import CSV de
routes/index.js. UmPOST /createanônimo comx in+ uma longa sequência de dígitos faziahumanize-ms/ms 0.7.xrodar em tempo quadrático e bloqueava o event loop para todos os usuários.package.json/package-lock.json:humanize-ms1.0.1 -> 1.2.1,ms^0.7.1 (0.7.3) -> 2.1.3,moment2.15.1 -> 2.29.4 (oms2.x ignora strings com mais de 100 chars; cópias aninhadas dems2.1.x foram deduplicadas).routes/index.js: novoMAX_PARSE_LENGTH = 1000. Acima disso o texto é salvo sem passar pelos parsers:[...].Como testar
Rodei o app real (
node app.js; o Mongo foi trocado por um stub em memória porque o mongod local não fala com mongoose 4.2.4) emmaine nesta branch, via curl:"buy milk in 2d"/"call mom in 90 minutes"buy milk [2d]/call mom [2h]"buy milk in "/"pay rent in soon"buy milk/pay rentfound img: http://…POST /createx in+1x5000/20000/50000+xGET /about_newconcorrente com o payload de 50 KBdentist,2016-10-01,en,LL+ linha de 50 KBdentist [October 1, 2016]Probe direto nas libs (
hms('1'.repeat(n)+'x'), n = 5k/20k/50k): 115 / 1497 / 8589 ms -> 0.3 / 0.1 / 0.2 ms.Fora do escopo:
GET /continua levando ~3-4 s quando há todos de 50 KB salvos, por causa domarked@0.3.5na renderização (finding separado, PRs #1077/#1088).npm test(snyk test) não roda aqui (sem token Snyk).Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/7690f99bb02549b799870d7135f24577
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/7690f99bb02549b799870d7135f24577?variant=devin
Devin Review