Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
git.sr.ht/~rj/sgr
Package sgr provides formatters to write ANSI escape sequences that can format and colorize text.
The package can be installed from the command line using the go tool. There are no dependencies beyond the standard library. Any version of Go should work.
go get git.sr.ht/~rj/sgr
Package documentation and examples are on Go Reference.
As a small introduction, the following snippet prints to the console using some bold text. You can experiment with the snippet on the go playground.
func main() {
// The formatter is responsible for deciding when and what escape
// codes to use. The call to NewFormatter will return a formatter
// suitable for use with standard out.
f := sgr.NewFormatter()
// Print some text with bold.
fmt.Println("Hello,", f.Bold("world!"))
}
To submit bug reports and suggestions, please use the issue tracker.
Discussions occur using the mailing list. The mailing list can also be used to submit patches.
This packages does not aim to support a complete list of SGR escape codes, either for all possible terminals or even as defined in the standard. The supported codes should be widely portable across many terminals and operating systems.
Windows: Terminals on windows will increasingly support ANSI escape sequences, but current support may be uneven. The legacy API for setting text attributes has been, if not deprecated, discouraged. Therefore, direct support for the legacy API is not planned. If older terminials must be supported, then go-colorable can be used.
BSD (c) Robert Johnstone
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.
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.