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.
github.com/H0llyW00dzZ/fiber2fa
This is a custom 2FA (Two-Factor Authentication) middleware for the Fiber web framework. It provides a secure and easy-to-use solution for implementing 2FA in Fiber applications. The middleware supports both HOTP (HMAC-based One-Time Password) and TOTP (Time-based One-Time Password) authentication and offers customizable configuration options.
[!WARNING] This 2FA middleware is still a work in progress and may not be stable for use in production environments (e.g., QR Code Builder), since it is rewritten from scratch with some improvements. Use it with caution and thoroughly test it before deploying to production. It is recommended to use it locally for testing purposes.
[!NOTE] This 2FA project was inspired by some QR code systems in my country (e.g., https://qris.id/). However, it is built in a modern way and purely written in Go (which is more secure and can leverage the system easily), rather than the traditional way (where it is written in PHP). More QR code system projects might be implemented in the future (e.g., payment systems through banking similar to https://qris.id/).
The middleware provides the following features:
[!NOTE] Some HOTP implementations here follow the standards defined in RFC 4226. However, they are built on top of modern & advanced cryptographic knowledge and best practices, rather than using outdated or traditional approaches. This is because
Go
is considered one of the best programming languages forcryptographic
implementations, compared toC
orC++
.
[!NOTE] Some TOTP implementations here adhere to the standards defined in RFC 6238. However, they are built on top of modern & advanced cryptographic knowledge and best practices, rather than relying on outdated or traditional methods. This is because
Go
is considered one of the best programming languages forcryptographic
implementations, compared toC
orC++
.
The notes effectively communicate that the HOTP and TOTP implementations follow the respective RFCs while leveraging modern and advanced cryptographic knowledge and best practices. The emphasis on Go's suitability for cryptographic implementations compared to C or C++ is also clearly stated.
More features and validation capabilities will be added in the future to enhance the middleware's functionality and cater to a wider range of validation scenarios.
goos: windows
goarch: amd64
pkg: github.com/H0llyW00dzZ/fiber2fa
cpu: AMD Ryzen 9 3900X 12-Core Processor
BenchmarkJSONSonicMiddlewareWithInvalidCookie-24 113605 9290 ns/op 6065 B/op 29 allocs/op
BenchmarkJSONSonicWithValid2FA-24 55086 21073 ns/op 9598 B/op 66 allocs/op
BenchmarkJSONSonicWithValidCookie-24 96120 12311 ns/op 7399 B/op 41 allocs/op
BenchmarkJSONStdLibraryMiddlewareWithInvalidCookie-24 128434 9386 ns/op 6003 B/op 29 allocs/op
BenchmarkJSONStdLibraryMiddlewareWithValid2FA-24 49399 24714 ns/op 8200 B/op 68 allocs/op
BenchmarkJSONStdLibraryWithValidCookie-24 60553 20039 ns/op 7108 B/op 46 allocs/op
[!NOTE] The benchmark results are based on the latest version of the middleware (v0.3.0) and were performed on a Windows machine with an AMD Ryzen 9 3900X 12-Core Processor. The results may vary depending on the system configuration and environment.
The benchmark tests cover different scenarios, including:
- Middleware performance with an invalid cookie using the Sonic JSON library
- Middleware performance with a valid 2FA token using the Sonic JSON library
- Middleware performance with a valid cookie using the Sonic JSON library
- Middleware performance with an invalid cookie using the standard library JSON package
- Middleware performance with a valid 2FA token using the standard library JSON package
- Middleware performance with a valid cookie using the standard library JSON package
The benchmark results provide insights into the performance characteristics of the middleware under different conditions and JSON libraries. It's important to consider these results when evaluating the middleware's suitability for specific use cases and performance requirements.
Also note that benchmark results may be updated in the future as the middleware evolves and new versions are released.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the BSD License.
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.