Full-Read SSRF via HTML Image Prefetch Renderer in Wiki.js - #8053
Open
bshakeel86 wants to merge 1 commit into
Open
Full-Read SSRF via HTML Image Prefetch Renderer in Wiki.js#8053bshakeel86 wants to merge 1 commit into
bshakeel86 wants to merge 1 commit into
Conversation
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.
## Description
Wiki.js v2.5.314 contains a Full-Read Server-Side Request Forgery (SSRF) vulnerability in the
html-image-prefetchrendering module (server/modules/rendering/html-image-prefetch/renderer.js). When this renderer is enabled by an administrator, any<img>element withclass="prefetch-candidate"in a page's HTML content causes the wiki server to make a server-side GET request to the element'ssrcURL usingrequest-promise— with no URL validation, no private IP blocking, and no allowlist. The complete HTTP response body is base64-encoded and embedded as adata:URI in the rendered page HTML, making the full response contents visible to any page viewer. This is the first full-read SSRF finding in Wiki.js history.Pre-condition: The
html-image-prefetchrenderer must be enabled by an administrator (Administration → Rendering → HTML Image Prefetch → ON). It is disabled by default (enabledDefault: false). Once enabled, any editor-level user can exploit this without further admin interaction.## Reproduction Steps
127.0.0.1:19876) serving a file/secrets.txtwith sensitive content. Verify from an external browser thathttp://<wiki-host>:19876/secrets.txtreturns connection refused.attacker@test.local) with onlywrite:pagespermission.<img>tag and observe thesrcattribute has been replaced with adata:text/plain;base64,...URI./secrets.txtare returned — a resource that was unreachable from the external browser.