question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Security proposition

See original GitHub issue

Problem:

node-postgres depends (directly and recursively) on 16 other packages. May any of these become controlled by an attacker, the baddies can easily control your application’s backend via node-postgres.

This is well-known and serious attack:

https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5

https://schneid.io/blog/event-stream-vulnerability-explained/

It scares me anytime I hit npm install.

Solution:

Most of the dependencies have quite short codes, so it’s trivial to ‘embed’ them to the project directly. I consider success even partial dependency elimination, as it reduces the attack surface.

Realization:

If agreed, I’m happy to do the change and submit PR.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
abenhamdinecommented, Sep 2, 2020

I’m more than a little confused and this is probably not the right place but wanted to surface it at least somewhere; there’s a npm package called node-postgres which is not this pg package npmjs.com/package/node-postgres. Aside from general confusion, just wanted to make sure you’re aware of this and the potential for users to be misled.

Definitely worrying to see that. Name usurpation/confusion is obviously an easy vector attack.

1reaction
benjiecommented, Feb 9, 2019

Agree with @charmander (except using yarn.lock); vendoring non-trivial dependencies raises issues due to using stale code which may have vulnerabilities in - it massively increases the work required of the maintainer to keep things up to date and makes it harder for users to patch their own systems using tools like Snyk to upgrade/patch certain dependencies.

When you run code in the node ecosystem, using a lockfile is critical, and when you upgrade modules you should review their changelogs and ensure they’re safe.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Sets You Apart? How to Create a Security Value ...
Endorsing your security services through a compelling value proposition is a sure fire way to secure more contracts during the sales process
Read more >
Cyber posture: the value proposition of security
Effective cyber security solutions, as well as being a core value proposition for organisations, are also a necessity for management teams, board members ......
Read more >
Security as a Business Value Proposition | by Rob Ellis | Medium
Security as a Business Value Proposition · 1. Data, hardware, and software protection · 2. Scaling support · 3. Secure third-party access ·...
Read more >
The Guide to Presenting Information Security's Business Value
Discover the key elements of articulating cyber and information security's business value to non-technical stakeholders.
Read more >
How to Develop Your Security Guard Company's Unique ...
Developing your unique selling proposition is a two-step process: 1) Identify your niche and then 2) excel in that area. “Today everyone wants...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found