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.

feature request for `require.pure(id)` or `pkg.pure:true`

See original GitHub issue

Feature request.

Most third part module we are using are pure function things. If we can control that (when we require them even install them), then maybe most security problems could under control easily?

“pure module require” means:

  1. no i/o, like fs, net native module.
  2. no context pollute, like viciously rewritting to standard lib and native module exports.
  3. other things, like Buffer.allocUnsafe, child_process API.
  4. pkg.scripts field actions will have no chance to attack the computer.
  5. pure module can only require pure module.

soft additional design objective:

  1. maybe we need “pureAsync”, different with “pure(Sync)”, to give a way auto force run in “Worker”-like thing, to protect “while ( true ) ;” (and bind to cpu different with main app context). not very important, because it’s almost no benefit for author, and easy to be found by the most careless user (no different with a lib has no user just because it’s too slow).
  2. maybe we need consider “import” solution together, like “import mod from ‘x’ assert { pure: ‘sync’ }”.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RafaelGSScommented, Nov 10, 2022

It seems a feature request, feel free to join the Security WG to share your point of view. Honestly, I see it overlapping with #791.

1reaction
vdeturckheimcommented, Feb 19, 2019

@LongTengDao sure, here is a wiki page https://github.com/google/caja/wiki/SES

you can also check the current state of the realms proposal on TC39 https://github.com/tc39/proposal-realms

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · nodejs/security-wg - GitHub
feature request for require.pure (id) or pkg.pure:true question. #467 opened on Dec 29, 2018 by LongTengDao · 16. ProTip! Find all open issues...
Read more >
How we handle feature requests - Artlogic Support
Following our internal feature request meetings, viable requests are selected and then considered for inclusion in our development schedule. This schedule is ...
Read more >
Feature Requests - Jamf Nation Community - 58
In order to create a new feature request, comment, or vote, you will need to log in with your Jamf ID. You may...
Read more >
Feature request forum for products - Hellonext
Learn how Hellonext can help you build a feature request forum to gather customer feature ... No credit card required • Free for...
Read more >
Add existing download to another package using the ID field
FEATURE REQUEST : Add existing download to another package using the ID field · Viewing 1 post (of 1 total) · Dec 12,...
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