High

Private Data Disclosure in express-restify-mongoose

  • Disclosed: 23.10.2018
  • Updated: 11.10.2026 10:22

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 software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package express-restify-mongoose >= 3.0.0, < 3.1.0, < 2.5.0 3.1.0, 2.5.0

References

CVSS score -
Weakness (CWE)
CWE-200
Platform
npm
Package
express-restify-mongoose
Disclosed
23.10.2018
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-cgjx-mwpx-47jv - CC BY 4.0

Vulnerability history: express-restify-mongoose

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.