
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
shared-context
Advanced tools
This module provides a middleware which is easily used to share data between the front and back end. The data is properly escaped for insertion directly into the html of a page to protect you against script injection attacks. This is a common pattern used for applications that have heavy front-end javascript components like React or Angular apps.
If you are using an isomorphic router pattern, like the Express with Nighthawk, you can use this middleware on both sides and it will handle the data loading for you. Check out the example for more details on this pattern.
$ npm install --save shared-context
// index.js
var app = require('express')();
var sharedContext = require('shared-context');
app.use(sharedContext({
// Options and their defaults
// browserVar: '__context'
// localsVar: 'context'
}));
app.get('/', function (req, res) {
// Set some data on the context,
// in a real app this would come from
// some api or other data source
res.locals.context.title = 'Foo\'s Day at the Bar';
// Render the template
res.render('index');
});
<html>
<!-- other stuff in here -->
<script>
__context = <%- JSON.stringify(context) %>
</script>
<script src="/browser.js"></script>
</html>
// browser.js
var app = require('nighthawk')();
var sharedContext = require('shared-context');
app.use(sharedContext());
app.get('/', function (req, res) {
// Do browser type stuff, like bind events
// or render a react applicaion
console.log(res.locals.context.title); // 'Foo\'s Day at the Bar'
});
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.