jsgiven/jsgiven:js-given/package.json

JavaScript frontend to jgiven.
Vulnerabilities 12 via 13 paths
Dependencies 118
Source GitHub
Commit 3d412401

Snyk continuously finds and fixes vulnerabilities in your dependencies.

Filter by issue type
  • 5
  • 6
  • 1
Filter by issue policy
  • 0
  • 0
high severity

Content & Code Injection (XSS)

  • Vulnerable module: marked
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 modernizr@3.3.1 marked@0.3.5
    Remediation: Run snyk wizard to patch marked@0.3.5.

Overview

marked is a markdown parser and compiler used for rendering markdown content to html.

It is vulnerable to content injection attack allowing the attacker to bypass its output sanitization (sanitize: true) protection. Using the HTML Coded Character Set, attackers can inject javascript: code snippets into the output. For example, the following input javascript&#x58document;alert(1) will result in alert(1) being executed when the user clicks on the link.

Details

Cross-Site Scripting (XSS) attacks occur when an attacker tricks a user’s browser to execute malicious JavaScript code in the context of a victim’s domain. Such scripts can steal the user’s session cookies for the domain, scrape or modify its content, and perform or modify actions on the user’s behalf, actions typically blocked by the browser’s Same Origin Policy.

These attacks are possible by escaping the context of the web application and injecting malicious scripts in an otherwise trusted website. These scripts can introduce additional attributes (say, a "new" option in a dropdown list or a new link to a malicious site) and can potentially execute code on the clients side, unbeknown to the victim. This occurs when characters like \< > \" \' are not escaped properly.

There are a few types of XSS:

  • Persistent XSS is an attack in which the malicious code persists into the web app’s database.
  • Reflected XSS is an which the website echoes back a portion of the request. The attacker needs to trick the user into clicking a malicious link (for instance through a phishing email or malicious JS on another page), which triggers the XSS attack.
  • DOM-based XSS is an that occurs purely in the browser when client-side JavaScript echoes back a portion of the URL onto the page. DOM-Based XSS is notoriously hard to detect, as the server never gets a chance to see the attack taking place.

Remediation

Upgrade marked to version 0.3.6 or higher. Also, you can patch the vulnerability using Snyk wizard.

References

high severity

Cross-site Scripting (XSS)

  • Vulnerable module: marked
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 modernizr@3.3.1 marked@0.3.5

Overview

marked is a markdown parser and compiler used for rendering markdown content to html.

Affected versions of the package are vulnerable to Cross-site Scripting (XSS) attacks.

Details

Browsers support both lowercase and uppercase x in hexadecimal form of HTML character entity, but marked unescaped only lowercase.

This may allow an attacker to create a link with javascript code.

For example:

var marked = require('marked');
        marked.setOptions({
          renderer: new marked.Renderer(),
          sanitize: true
        });
        
        text = `
        lower[click me](javascript&#x3a;...)lower
        upper[click me](javascript&#X3a;...)upper
        `;
        
        console.log(marked(text));
        

will render the following:

<p>lowerlower
        upper<a href="javascript&#X3a;...">click me</a>upper</p>
        
        

Details

Cross-Site Scripting (XSS) attacks occur when an attacker tricks a user’s browser to execute malicious JavaScript code in the context of a victim’s domain. Such scripts can steal the user’s session cookies for the domain, scrape or modify its content, and perform or modify actions on the user’s behalf, actions typically blocked by the browser’s Same Origin Policy.

These attacks are possible by escaping the context of the web application and injecting malicious scripts in an otherwise trusted website. These scripts can introduce additional attributes (say, a "new" option in a dropdown list or a new link to a malicious site) and can potentially execute code on the clients side, unbeknown to the victim. This occurs when characters like \< > \" \' are not escaped properly.

There are a few types of XSS:

  • Persistent XSS is an attack in which the malicious code persists into the web app’s database.
  • Reflected XSS is an which the website echoes back a portion of the request. The attacker needs to trick the user into clicking a malicious link (for instance through a phishing email or malicious JS on another page), which triggers the XSS attack.
  • DOM-based XSS is an that occurs purely in the browser when client-side JavaScript echoes back a portion of the URL onto the page. DOM-Based XSS is notoriously hard to detect, as the server never gets a chance to see the attack taking place.

Remediation

Upgrade marked to version 0.3.9 or higher.

References

high severity

Cross-site Scripting (XSS) via Data URIs

  • Vulnerable module: marked
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 modernizr@3.3.1 marked@0.3.5
    Remediation: Run snyk wizard to patch marked@0.3.5.

Overview

marked is a markdown parser and compiler used for rendering markdown content to html.

Affected versions of the package are vulnerable to Cross-site Scripting (XSS). Data URIs enable embedding small files in line in HTML documents, provided in the URL itself. Attackers can craft malicious web pages containing either HTML or script code that utilizes the data URI scheme, allowing them to bypass access controls or steal sensitive information.

An example of data URI used to deliver javascript code. The data holds <script>alert('XSS')</script> tag in base64 encoded format.

[xss link](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K)
        

Details

Cross-Site Scripting (XSS) attacks occur when an attacker tricks a user’s browser to execute malicious JavaScript code in the context of a victim’s domain. Such scripts can steal the user’s session cookies for the domain, scrape or modify its content, and perform or modify actions on the user’s behalf, actions typically blocked by the browser’s Same Origin Policy.

These attacks are possible by escaping the context of the web application and injecting malicious scripts in an otherwise trusted website. These scripts can introduce additional attributes (say, a "new" option in a dropdown list or a new link to a malicious site) and can potentially execute code on the clients side, unbeknown to the victim. This occurs when characters like \< > \" \' are not escaped properly.

There are a few types of XSS:

  • Persistent XSS is an attack in which the malicious code persists into the web app’s database.
  • Reflected XSS is an which the website echoes back a portion of the request. The attacker needs to trick the user into clicking a malicious link (for instance through a phishing email or malicious JS on another page), which triggers the XSS attack.
  • DOM-based XSS is an that occurs purely in the browser when client-side JavaScript echoes back a portion of the URL onto the page. DOM-Based XSS is notoriously hard to detect, as the server never gets a chance to see the attack taking place.

Remediation

Upgrade marked to version 0.3.7 or higher. Also, you can patch the vulnerability using Snyk wizard.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: marked
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 modernizr@3.3.1 marked@0.3.5
    Remediation: Run snyk wizard to patch marked@0.3.5.

Overview

marked is a full-featured markdown parser and compiler.

Affected versions of this package are vulnerable to Regular expression Denial of Service (ReDoS) attacks when parsing the input markdown content (1,000 characters costs around 6 seconds matching time).

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/
        

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
        0.04s user 0.01s system 95% cpu 0.052 total
        
        $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
        1.79s user 0.02s system 99% cpu 1.812 total
        

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade marked to version 0.3.9 or higher. In the meantime, you can patch the vulnerability using Snyk wizard.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: marked
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 modernizr@3.3.1 marked@0.3.5

Overview

marked is a markdown parser built for speed

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks. This can cause an impact of about 10 seconds matching time for data 150 characters long.

Disclosure Timeline

  • Feb 21th, 2018 - Initial Disclosure to package owner
  • Feb 21th, 2018 - Initial Response from package owner
  • Feb 26th, 2018 - Fix issued
  • Feb 27th, 2018 - Vulnerability published

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/
        

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
        0.04s user 0.01s system 95% cpu 0.052 total
        
        $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
        1.79s user 0.02s system 99% cpu 1.812 total
        

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade marked to version 0.3.17 or higher

References

medium severity

Content Security Policy (CSP) Bypass

  • Vulnerable module: angular
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 angular@1.5.8

Overview

angular is an open-source JavaScript framework, maintained by Google, that assists with running single-page applications with the goal of making development and testing easier by augmenting browser-based applications with model–view–controller (MVC) capability.

Affected versions of the package are vulnerable to CSP Bypass. Extension URIs (resource://...) bypass Content-Security-Policy in Chrome and Firefox and can always be loaded. Now if a site already has a XSS bug, and uses CSP to protect itself, but the user has an extension installed that uses Angular, an attacker can load Angular from the extension, and Angular's auto-bootstrapping can be used to bypass the victim site's CSP protection.

Remediation

Upgrade angular to version 1.5.9 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: angular
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 angular@1.5.8

Overview

angular is an HTML enhanced for web apps.

Affected versions of the package are vulnerable to Cross-site Scripting (XSS) via ideographic space chararcters in URIs.

Browsers mutate attributes values such as &#12288;javascript:alert(1) when they are written to the DOM via innerHTML in various vendor specific ways. In Chrome (<62), this mutation removed the preceding "whitespace" resulting in a value that could end up being executed as JavaScript.

Here is an example of what could happen:

// Code goes here
        var h1 = document.querySelector('h1');
        h1.innerHTML = '<a href="&#x3000;javascript:alert(1)">CLICKME</a>';
        var innerHTML = h1.innerHTML;
        console.log(innerHTML);
        h1.innerHTML = innerHTML;
        

The sanitizer contains a bit of code that triggers this mutation on an inert piece of DOM, before angular sanitizes it.

Note: Chrome 62 does not appear to mutate this particular string any more, instead it just leaves the "whitespace" in place. This probably means that Chrome 62 is no longer vulnerable to this specific attack vector.

Details

Cross-Site Scripting (XSS) attacks occur when an attacker tricks a user’s browser to execute malicious JavaScript code in the context of a victim’s domain. Such scripts can steal the user’s session cookies for the domain, scrape or modify its content, and perform or modify actions on the user’s behalf, actions typically blocked by the browser’s Same Origin Policy.

These attacks are possible by escaping the context of the web application and injecting malicious scripts in an otherwise trusted website. These scripts can introduce additional attributes (say, a "new" option in a dropdown list or a new link to a malicious site) and can potentially execute code on the clients side, unbeknown to the victim. This occurs when characters like \< > \" \' are not escaped properly.

There are a few types of XSS:

  • Persistent XSS is an attack in which the malicious code persists into the web app’s database.
  • Reflected XSS is an which the website echoes back a portion of the request. The attacker needs to trick the user into clicking a malicious link (for instance through a phishing email or malicious JS on another page), which triggers the XSS attack.
  • DOM-based XSS is an that occurs purely in the browser when client-side JavaScript echoes back a portion of the URL onto the page. DOM-Based XSS is notoriously hard to detect, as the server never gets a chance to see the attack taking place.

Remediation

Upgrade angular to version 1.6.7 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: angular
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 angular@1.5.8

Overview

angularjs is a toolset for building the framework suited to your application development.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) through SVG files if enableSvg is set.

Details

Cross-Site Scripting (XSS) attacks occur when an attacker tricks a user’s browser to execute malicious JavaScript code in the context of a victim’s domain. Such scripts can steal the user’s session cookies for the domain, scrape or modify its content, and perform or modify actions on the user’s behalf, actions typically blocked by the browser’s Same Origin Policy.

These attacks are possible by escaping the context of the web application and injecting malicious scripts in an otherwise trusted website. These scripts can introduce additional attributes (say, a "new" option in a dropdown list or a new link to a malicious site) and can potentially execute code on the clients side, unbeknown to the victim. This occurs when characters like \< > \" \' are not escaped properly.

There are a few types of XSS:

  • Persistent XSS is an attack in which the malicious code persists into the web app’s database.
  • Reflected XSS is an which the website echoes back a portion of the request. The attacker needs to trick the user into clicking a malicious link (for instance through a phishing email or malicious JS on another page), which triggers the XSS attack.
  • DOM-based XSS is an that occurs purely in the browser when client-side JavaScript echoes back a portion of the URL onto the page. DOM-Based XSS is notoriously hard to detect, as the server never gets a chance to see the attack taking place.

Remediation

Upgrade angular to version 1.6.9 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: foundation-sites
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 foundation-sites@5.5.3

Overview

foundation-sites is an advanced responsive front-end framework.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) attacks due to an insufficient fix to npm:foundation-sites:20150619

Thanks to Nathaniel Paulus for disclosing this vulnerability!

Although innerHTML does not make script tags executable, script tags are not the only way to run arbitrary code.

This vulnerability was introduced in a deliberate attempt to allow HTML in captions. The file was subsequently deleted when version 6 was merged into the develop branch in 1e08494bb2118c9786ffc33c28158311cd542bcb. Confirmation of its removal (as well as plans to re-add it) can be found in issue 7759

Details

Cross-Site Scripting (XSS) attacks occur when an attacker tricks a user’s browser to execute malicious JavaScript code in the context of a victim’s domain. Such scripts can steal the user’s session cookies for the domain, scrape or modify its content, and perform or modify actions on the user’s behalf, actions typically blocked by the browser’s Same Origin Policy.

These attacks are possible by escaping the context of the web application and injecting malicious scripts in an otherwise trusted website. These scripts can introduce additional attributes (say, a "new" option in a dropdown list or a new link to a malicious site) and can potentially execute code on the clients side, unbeknown to the victim. This occurs when characters like \< > \" \' are not escaped properly.

There are a few types of XSS:

  • Persistent XSS is an attack in which the malicious code persists into the web app’s database.
  • Reflected XSS is an which the website echoes back a portion of the request. The attacker needs to trick the user into clicking a malicious link (for instance through a phishing email or malicious JS on another page), which triggers the XSS attack.
  • DOM-based XSS is an that occurs purely in the browser when client-side JavaScript echoes back a portion of the URL onto the page. DOM-Based XSS is notoriously hard to detect, as the server never gets a chance to see the attack taking place.

Disclosure Timeline

  • March 14th, 2017 - Responsible Disclosure and PoC sent by Nathaniel Paulus.
  • April 13th, 2017 - Disclosure to first contact @foundation-sites
  • May 14th, 2017 - Disclosure to first and secondary contacts @foundation-sites
  • June 12th, 2017 - After no response from either contact, PoC sent to both contacts.
  • August 2nd, 2017 - Vulnerability made public.

Remediation

Upgrade foundation-sites to version 6.0.0 or higher.

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: marked
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 modernizr@3.3.1 marked@0.3.5

Overview

marked is a markdown parser and compiler used for rendering markdown content to html.

Affected versions of the package are vulnerable to Cross-site Scripting (XSS) attacks.

Details

When mangling is disabled via option mangle, marked doesn't escape target href. This may allow an attacker to inject arbitrary html-event into resulting a tag.

For example:

var marked = require('marked');
        marked.setOptions({
          renderer: new marked.Renderer(),
          sanitize: true,
          mangle: false
        });
        
        text = `
        <bar"onclick="alert('XSS')"@foo>
        `;
        
        console.log(marked(text));
        

will render:

<p><a href="mailto:bar"onclick="alert('XSS')"@foo">bar"onclick="alert('XSS')"@foo</a></p>
        

Details

Cross-Site Scripting (XSS) attacks occur when an attacker tricks a user’s browser to execute malicious JavaScript code in the context of a victim’s domain. Such scripts can steal the user’s session cookies for the domain, scrape or modify its content, and perform or modify actions on the user’s behalf, actions typically blocked by the browser’s Same Origin Policy.

These attacks are possible by escaping the context of the web application and injecting malicious scripts in an otherwise trusted website. These scripts can introduce additional attributes (say, a "new" option in a dropdown list or a new link to a malicious site) and can potentially execute code on the clients side, unbeknown to the victim. This occurs when characters like \< > \" \' are not escaped properly.

There are a few types of XSS:

  • Persistent XSS is an attack in which the malicious code persists into the web app’s database.
  • Reflected XSS is an which the website echoes back a portion of the request. The attacker needs to trick the user into clicking a malicious link (for instance through a phishing email or malicious JS on another page), which triggers the XSS attack.
  • DOM-based XSS is an that occurs purely in the browser when client-side JavaScript echoes back a portion of the URL onto the page. DOM-Based XSS is notoriously hard to detect, as the server never gets a chance to see the attack taking place.

Remediation

Upgrade marked to version 0.3.9 or higher.

References

medium severity

JSONP Callback Attack

  • Vulnerable module: angular
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 angular@1.5.8

Overview

angular is an open-source JavaScript framework, maintained by Google, that assists with running single-page applications with the goal of making development and testing easier by augmenting browser-based applications with model–view–controller (MVC) capability.

Affected versions of the package are vulnerable to JSONP Callbacks attacks.

JSONP (JSON with padding) is a method used to request data from a server residing in a different domain than the client.

Any url could perform JSONP requests, allowing full access to the browser and the JavaScript context. This can lead to Cross-site Scripting.

Remediation

Upgrade angular to version 1.6.1 or higher.

References

low severity

Prototype Pollution

  • Vulnerable module: lodash
  • Introduced through: jgiven-html-app@0.16.2

Detailed paths

  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 lodash@4.17.3
  • Introduced through: js-given@jsgiven/jsgiven#3d4124019095a81a0e9cc7f0adb7c1d4edea0630 jgiven-html-app@0.16.2 modernizr@3.3.1 lodash@4.0.0

Overview

lodash is a javaScript utility library delivering modularity, performance & extras.

Affected versions of this package are vulnerable to Prototype Pollution. The utilities function allow modification of the Object prototype. If an attacker can control part of the structure passed to this function, they could add or modify an existing property.

PoC by Olivier Arteau (HoLyVieR)

var _= require('lodash');
        var malicious_payload = '{"__proto__":{"oops":"It works !"}}';
        
        var a = {};
        console.log("Before : " + a.oops);
        _.merge({}, JSON.parse(malicious_payload));
        console.log("After : " + a.oops);
        

Remediation

Upgrade lodash to version 4.17.5 or higher.

References