Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/ro-29/dependency-injection-go
➜ go run main.go
** Init DI Provider A **<
** Init serviceA **
** Init DI Provider B **
** Init serviceB **
from A:
hey there: testing
** Init DI Provider C **
** Init serviceC **
** Using already init DI Provider B **
from C:
hey there: testing
Go uses struct and interfaces to declare a service. A service can inherit another service and as many it wants ( but we must try to keep it minimal for loosely coupled dependency graph)
This tutorial assumes all the go services must be initialized at the program initiation not at the run time of program.
Now the problem can arise if a service is required by multiple services! It will essentially means we will be initializing a service as many times as it is required by other services. It's not an ideal scenario in a case service that is being initialized multiple times has a network related dependency like database initialization or some other complex initialization.
Lets view this problem from the famous diamond perspective but there is no actual inheritance here just the service dependency angle. (Though go supports inheritance but this is out of scope of this tutorial)
A
B C
D
**Incomplete
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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.