Giter Site home page Giter Site logo

body-parser-xml's People

Contributors

dependabot-preview[bot] avatar equals182 avatar fiznool avatar sebdec avatar yadhukrishnam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

body-parser-xml's Issues

๐Ÿšจ Potential Prototype Pollution

๐Ÿ‘‹ Hello, @fiznool - a potential high severity Prototype Pollution vulnerability in your repository has been disclosed to us.

Next Steps

1๏ธโƒฃ Visit https://huntr.dev/bounties/1-other-fiznool/body-parser-xml for more advisory information.

2๏ธโƒฃ Sign-up to validate or speak to the researcher for more assistance.

3๏ธโƒฃ Propose a patch or outsource it to our community - whoever fixes it gets paid.


Confused or need more help?

  • Join us on our Discord and a member of our team will be happy to help! ๐Ÿค—

  • Speak to a member of our team: @JamieSlome


This issue was automatically generated by huntr.dev - a bug bounty board for securing open source code.

xml2js is vulnerable to prototype pollution

npm audit is informing me of this vulnerability:

xml2js  <=0.4.23
Severity: high
xml2js is vulnerable to prototype pollution  - https://github.com/advisories/GHSA-776f-qx25-q3cc
No fix available
node_modules/xml2js
  body-parser-xml  *
  Depends on vulnerable versions of xml2js
  node_modules/body-parser-xml

xml2js released 0.5.0 version with this fix, please update the dependency.

es6 import. UnhandledPromiseRejectionWarning

as described in this issue, I import lib as follows:

import bodyParser from "body-parser";
import bodyParserXml from "body-parser-xml";

However, then I get

(node:98360) UnhandledPromiseRejectionWarning: TypeError: body_parser_xml_1.default is not a function

Usage with require works well, but is not wanted by Eslint.
Do you have suggestion how to fix this?

parseString() missing error management

Hi,
I was trying to open a PR but i have trouble with permissions.

In some cases xml2js.Parser parseString() can throw an error after execute the callback.

This leads to the emission of a node 'uncaughtException' in the express application.

Following lines (index.js 32-40)

parser.parseString(req.body, function(err, xml) {
    if(err) {
        err.status = 400;
        return next(err);
    }

    req.body = xml || req.body;
    next();
});

Should be wrapped

try {
    parser.parseString(req.body, function(err, xml) {
        if(err) {
            err.status = 400;
            return next(err);
        }
    
        req.body = xml || req.body;
        next();
    });
} catch (err) {
    // in some cases xml2js.Parser parseString() can
    // throw an error after execute the callback
    // see it source code for more details
}

Dev dependencies out of date.

Hi Could you update your dev dependencies, as they are out of date. This is a great module and I would hate for it to break down! Thanks!

Support bodyparser's 'type' option as function

This module uses bodyparser.text() to parse body as text and passes options object to configure it.

As you can see here, bodyparser accepts options.type options as function, which allows user to control type matching precisely.

Unfortunately, in body-parser-xml there is a line where it check if passed options.type is not an array and convert it into array thus breaking default bodyparser.text()'s ability to use user's function, because that function checks if passed 'type' option is a function

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.