Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWNnangtbXdweC00N2p2

Private Data Disclosure in express-restify-mongoose

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.

Permalink: https://github.com/advisories/GHSA-cgjx-mwpx-47jv
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWNnangtbXdweC00N2p2
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 5 years ago
Updated: about 1 year ago


Identifiers: GHSA-cgjx-mwpx-47jv, CVE-2016-10533
References: Repository: https://github.com/florianholzapfel/express-restify-mongoose
Blast Radius: 0.0

Affected Packages

npm:express-restify-mongoose
Dependent packages: 16
Dependent repositories: 194
Downloads: 8,711 last month
Affected Version Ranges: >= 3.0.0, <= 3.0.1, <= 2.4.2
Fixed in: 3.1.0, 2.5.0
All affected versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.1.0, 0.1.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5.6, 0.5.7, 0.5.8, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.6.7, 0.6.8, 0.6.9, 0.6.10, 0.6.11, 0.7.0, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.1, 1.1.2, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.4.0, 2.4.1, 2.4.2, 3.0.0, 3.0.1
All unaffected versions: 2.5.0, 3.1.0, 3.1.1, 3.2.0, 3.2.1, 4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.2.0, 4.2.1, 4.2.2, 4.3.0, 5.0.0, 5.1.0, 6.0.0, 6.1.1, 6.1.2, 7.0.2, 8.0.0, 9.0.1, 9.0.2, 9.0.3, 9.0.4