Repository navigation
bug: fix stored XSS in todo content (marked 4.3.0 + sanitize-html) - #1109
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Refs: sfind-2de74fd9447e4e70a2fafe668d3c5c44
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Refs: sfind-2de74fd9447e4e70a2fafe668d3c5c44
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Refs: sfind-2de74fd9447e4e70a2fafe668d3c5c44
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.
|
Allow <del>, and <input> rewritten to a disabled checkbox (only type/checked/disabled survive), so GFM ~~text~~ and - [x] items render after sanitize-html. Refs: sfind-2de74fd9447e4e70a2fafe668d3c5c44 Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Resumo
Corrige o XSS armazenado via conteúdo do todo (finding
sfind-2de74fd9447e4e70a2fafe668d3c5c44, médio).views/index.ejsimprimemarked(todo.content)com<%- %>, e osanitize: truedo marked 0.3.5 é contornável:[x](javascript:this;alert(1))passa pelounescape()do marked (virajavascriptalert(1)), mas o navegador decodifica:como:e o link ficajavascript:this;alert(1).Mudança (só
app.js+ dependências; o template continua igual):marked0.3.5 → 4.3.0 (const { marked } = require('marked')),sanitize-html2.17.1 novo;package-lock.jsonatualizado.<script>,<img onerror>,<a href="javascript:">) agora é removido pelo sanitizer, em vez de virar texto escapado como nosanitize: true. Markdown normal (negrito, itálico,~~tachado~~, task list- [x], links http(s), imagens http(s)) continua renderizando; qualquer<input>cru vira checkbox desabilitado sem outros atributos./createe a renderização de/iguais).Duplicidade: é o mesmo diff da branch
devin/1793687177-fix-marked-xss(3 commits cherry-picked) + 1 commit para preservar<del>e checkboxes de task list (apontado pelo Devin Review) e se sobrepõe ao upgrade do marked em #1077 / #1088. Aberto como PR novo porque é um ticket novo; só um deve ser mergeado.Como testar
Rodei o app real (
node app.js, com um stub em memória do Mongoose, porque o mongod 7 local não fala com o mongoose 4.2.4), postei 13 payloads viaPOST /create, peguei o HTML deGET /e cliquei em cada link no Chrome (Playwright via CDP), registrando todoalert().main(marked 0.3.5)[x](javascript:this;alert('J'))href="javascript:this;alert('J')", o clique dispara alert("J")href="javascript:this;..."(URL relativa, sem esquemajavascript:), sem alert[x](javascript:alert(1))(payload do finding)<a>x</a>sem href[x](data:text/html;base64,...)href="data:..."<a>x</a><img src=x onerror=...>,<script>**bold** [safe](https://example.com) Para reproduzir: suba o app, poste
[x](javascript:this;alert(1))em/create, abra/e clique no link: nomainaparece o alert; neste PR o href não tem esquemajavascript:.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/ea0ed0b9b4c9421fa387909a7ccbdf8b
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/ea0ed0b9b4c9421fa387909a7ccbdf8b?variant=devin
Devin Review