Lucene search

K
githubGitHub Advisory DatabaseGHSA-CGJX-MWPX-47JV
HistoryOct 23, 2018 - 5:14 p.m.

Private Data Disclosure in express-restify-mongoose

2018-10-2317:14:57
CWE-200
GitHub Advisory Database
github.com
12

4 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

SINGLE

Confidentiality Impact

PARTIAL

Integrity Impact

NONE

Availability Impact

NONE

AV:N/AC:L/Au:S/C:P/I:N/A:N

8.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

0.001 Low

EPSS

Percentile

43.5%

Affected versions of express-restify-mongoose are susceptible to an information leakage vulnerability which may allow an attacker to access fields on a model even if those fields are marked as private.

Proof of Concept

If you have a user model that you want to protect, such as the following User model:

const User = mongoose.model('User', new mongoose.Schema({
    name: String,
    password: String,
}));

You would normally do something such as:

restify.serve(router, User, {
    private: ['password'], // Set the password part of User as private, so outside people can't read it
})

This would hide the password field from people that send your application a GET /User and GET /User/some-user-id request.

A malicious user can go to your application and send a request for GET /User?distinct=password and get all the passwords for all the users in the database, despite the field being set to private. This could be used for other private data, if the malicious user knew what was set as private for specific routes.

Recommendation

Version 2.x: Update to version 2.5.0 or later.
Version 3.x: Update to version 3.1.0 or later.

Affected configurations

Vulners
Node
express-restify-mongoose_projectexpress-restify-mongooseRange3.0.1node.js
OR
express-restify-mongoose_projectexpress-restify-mongooseRange2.4.2node.js

4 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

SINGLE

Confidentiality Impact

PARTIAL

Integrity Impact

NONE

Availability Impact

NONE

AV:N/AC:L/Au:S/C:P/I:N/A:N

8.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

0.001 Low

EPSS

Percentile

43.5%

Related for GHSA-CGJX-MWPX-47JV