adam-26/react-router-dispatcher-redirect

View on GitHub

Showing 15 of 15 total issues

Function redirectAction has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

export default function redirectAction(options: Object = {}) {
    invariant(options.to, 'redirectAction() requires a \'to\' prop value.');

    const {
        statusCode,
Severity: Minor
Found in src/redirectAction.js - About 1 hr to fix

    Function redirectAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Confirmed

    export default function redirectAction(options: Object = {}) {
        invariant(options.to, 'redirectAction() requires a \'to\' prop value.');
    
        const {
            statusCode,
    Severity: Minor
    Found in src/redirectAction.js - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    parsejson Regular Expression Denial of Service
    Confirmed

            "parsejson": {
              "version": "0.0.3",
              "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz",
              "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=",
              "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The parsejson module is vulnerable to regular expression denial of service when untrusted user input is passed into it to be parsed.

    Recommendation:

    Until a fix is available do not use parsejson to parse json. Use JSON.parse() instead if available.

    growl Command Injection
    Confirmed

            "growl": {
              "version": "1.9.2",
              "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz",
              "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8="
            },
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Command Injection

    Overview:

    Growl adds growl notification support to nodejs.

    Growl does not properly sanitize input before passing it to exec, allowing for arbitrary command execution.

    Recommendation:

    Update to version 1.10.2 or greater

    debug Regular Expression Denial of Service
    Confirmed

                "debug": {
                  "version": "2.3.3",
                  "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz",
                  "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=",
                  "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

    Recommendation:

    Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

    debug Regular Expression Denial of Service
    Open

                "debug": {
                  "version": "2.6.8",
                  "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
                  "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=",
                  "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

    Recommendation:

    Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

    debug Regular Expression Denial of Service
    Confirmed

                "debug": {
                  "version": "2.3.3",
                  "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz",
                  "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=",
                  "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

    Recommendation:

    Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

    debug Regular Expression Denial of Service
    Confirmed

                "debug": {
                  "version": "2.3.3",
                  "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz",
                  "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=",
                  "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

    Recommendation:

    Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

    debug Regular Expression Denial of Service
    Confirmed

                "debug": {
                  "version": "2.3.3",
                  "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz",
                  "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=",
                  "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

    Recommendation:

    Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

    ws Denial of Service
    Confirmed

            "ws": {
              "version": "1.1.2",
              "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz",
              "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=",
              "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Denial of Service

    Overview:

    A specially crafted value of the Sec-WebSocket-Extensions header that used Object.prototype property names as extension or parameter names could be used to make a ws server crash.

    Proof of concept:

    const WebSocket = require('ws');
    const net = require('net');
    
    const wss = new WebSocket.Server({ port: 3000 }, function () {
      const payload = 'constructor';  // or ',;constructor'
    
      const request = [
        'GET / HTTP/1.1',
        'Connection: Upgrade',
        'Sec-WebSocket-Key: test',
        'Sec-WebSocket-Version: 8',
        `Sec-WebSocket-Extensions: ${payload}`,
        'Upgrade: websocket',
        '\r\n'
      ].join('\r\n');
    
      const socket = net.connect(3000, function () {
        socket.resume();
        socket.write(request);
      });
    });

    Recommendation:

    Upgrade to version 3.3.1 or greater

    debug Regular Expression Denial of Service
    Confirmed

                "debug": {
                  "version": "2.2.0",
                  "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
                  "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=",
                  "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

    Recommendation:

    Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

    debug Regular Expression Denial of Service
    Confirmed

                "debug": {
                  "version": "2.3.3",
                  "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz",
                  "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=",
                  "requires": {
    Severity: Minor
    Found in npm-shrinkwrap.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

    Recommendation:

    Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

    TODO found
    Confirmed

    // TODO: Once 4.2.1/4.3.x is released, this file can be deleted
    Severity: Minor
    Found in src/generatePath.js by fixme

    TODO found
    Confirmed

    // TODO: When new version of react-router is released, uncomment this - and remove copied code.
    Severity: Minor
    Found in src/redirectAction.js by fixme

    TODO found
    Confirmed

    // TODO: This is exported from react-router, but a new version has not been released
    Severity: Minor
    Found in src/generatePath.js by fixme
    Severity
    Category
    Status
    Source
    Language