Advisory

GHSA-cgjx-mwpx-47jv

Also known as: CVE-2016-10533

Summary

Private Data Disclosure in express-restify-mongoose

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2018-10-23 17:14 UTC
Modified
2023-11-08 03:58 UTC

Affected packages and fixes

express-restify-mongoose

npm · All systems

Affected

  • introduced 3.0.0, fixed 3.1.0 (semver)

Fixed versions

3.1.0

Fix

express-restify-mongoose

npm · All systems

Affected

  • introduced 0, fixed 2.5.0 (semver)

Fixed versions

2.5.0

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences