Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
github.com/xmedia-systems/caster
caster
is a dead simple and performant message broadcaster for Go with context support. It uses the publisher and subscriber pattern (pubsub) to broadcast messages from a single or multiple source channels to multiple subscriber channels. Subscribers can dynamically join and leave.
Suppose the Go channel is:
var srcCh <-chan interface{}
We can broadcast the messages coming out of it to multiple subscribers:
c := caster.New(nil)
go func() {
// subscriber #1
ch, _ := c.Sub(nil, 1)
for m := range ch {
// do anything to the broadcasted message
}
}()
go func() {
// subscriber #2
ch, _ := c.Sub(nil, 1)
for m := range ch {
// do anything to the broadcasted message
}
}()
go func() {
// publisher
for m := range srcCh {
c.Pub(m)
}
c.Close()
}()
Subscribers can join and leave at any time:
// join
ch1, _ := c.Sub(nil, 1)
// leave
c.Unsub(ch1)
// join with context and automatically leave when the context is canceled
ch2, _ := c.Sub(ctx, 1)
// join with 10 subscriber channel buffer
ch3, _ := c.Sub(ctx, 10)
caster
can associate with a context as well:
// `c` will be closed when the `ctx` is canceled
c := caster.New(ctx)
A boolean value is returned to indicate whether the caster
is still running or not:
_, ok := c.Sub(nil, 1)
if !ok {
// the caster has been closed, do something else
}
FAQs
Unknown package
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.