
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Dependency injection and inversion of control and library for simple service handling
Python module for IOC container using dependency injection (uses python 3+ type hints, supported until Python3.7)
from cynergy import container
class TestClass:
pass
class ParentClass:
def __init__(self, test_class: TestClass):
self.test_class = test_class
instance = container.get(ParentClass) # Returns TestClass initialized as singleton
print(type(instance)) # ParentClass
print(type(instance.test_class)) # TestClass
from cynergy import container
from cynergy.config import Config, MemoryConfig
from cynergy.attributes import arguments
@arguments(db=Config('db_name'),host=Config('hostname'))
class DbConnector:
def __init__(self, db: str, host: str):
self.db = db
self.host = host
container.initialize(MemoryConfig({
"db_name": "LocalDbName",
"hostname": "localhost"
}))
instance = container.get(DbConnector)
print(instance.db) # LocalDbName
print(instance.host) # localhost
** You can implement your own configuration provider (for exmaple you can create DbConfigProvider which provides your settings from the db)
from cynergy import container
class Original:
pass
class Other:
pass
container.register_class(Original, Other)
instance = container.get(Original)
print(type(instance)) # Other
from typing import List
from cynergy import container
class HandlerBase:
pass
class SomeHandler1(HandlerBase):
pass
class SomeHandler2(HandlerBase):
pass
class SomeService:
def __init__(self, handlers: List[HandlerBase]):
self.handlers = handlers
container.register_many(HandlerBase, [SomeHandler1, SomeHandler2])
instance = container.get(SomeService)
print(type(instance.handlers)) # list
print(type(instance.handlers[0])) # SomeHandler1
print(type(instance.handlers[1])) # SomeHandler2
FAQs
Dependency injection and inversion of control and library for simple service handling
We found that cynergy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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 flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.