VOOZH about

URL: https://security.snyk.io/vuln/npm:sequelize:20160115

⇱ Remote Memory Exposure in sequelize | CVE-2016-10550 | Snyk


Remote Memory Exposure Affecting sequelize package, versions <3.17.2


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS

The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.

1.91% (78th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDnpm:sequelize:20160115
  • published1 Apr 2016
  • disclosed15 Jan 2016
  • creditUnknown

Introduced: 15 Jan 2016

CVE-2016-10550  (opens in a new tab)
Common Vulnerabilities and Exposures (CVE) are common identifiers for publicly known security vulnerabilities
CWE-201  (opens in a new tab)
Common Weakness Enumeration (CWE) is a category system for software weaknesses

How to fix?

Upgrade sequelize to version >= 3.17.3

Overview

A potential memory disclosure vulnerability exists in sequelize versions prior to 3.17.2. A field of type DataTypes.BLOB can be used to expose sensitive information such as code, runtime memory and user data into the database.

Details

sequelize uses the Buffer type to represent DataTypes.BLOB. Initializing a Buffer with integer N creates a Buffer of length N with non zero-ed out memory. Example:

var x = new Buffer(100); // uninitialized Buffer of length 100
// vs
var x = new Buffer('100'); // initialized Buffer with value of '100'

Initializing a BLOB field in such manner will dump uninitialized memory into the database. The patch wraps Buffer field initialization in sequelize by converting a number value N to a string, initializing the Buffer with N in its ascii form.

#

Proof of concept

var Sequelize = require('sequelize');
var sequelize = new Sequelize('pastebin', null, null,
 { host: '127.0.0.1', dialect: 'postgres', });

var Task = sequelize.define('Pastebin', { title: Sequelize.STRING, content: Sequelize.BLOB, });

Task.create({ title: 'title', content: 100, }).then(function (task) { console.log(task.title); console.log(task.content); // will print out 100 bytes of previously used memory });

CVSS Base Scores

version 3.1

Snyk

6.5 medium
  • Attack Vector (AV)

    The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers).

    Network
  • Attack Complexity (AC)

    Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.

    Low
  • Privileges Required (PR)

    The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.

    None
  • User Interaction (UI)

    The vulnerable system can be exploited without interaction from any user.

    None
  • Scope (S)

    An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

    Unchanged
  • Confidentiality (C)

    There is some loss of confidentiality. Access to some restricted information is obtained, but the attacker does not have control over what information is obtained, or the amount or kind of loss is limited. The information disclosure does not cause a direct, serious loss to the impacted component.

    Low
  • Integrity (I)

    Modification of data is possible, but the attacker does not have control over the consequence of a modification, or the amount of modification is limited. The data modification does not have a direct, serious impact on the impacted component.

    Low
  • Availability (A)

    There is no impact to availability within the impacted component.

    None