
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).
This Python package provides decorators to handle exceptions, measure execution time, and set timeouts.
To install decoratorsutility, simply use pip:
pip install decoratorsutility
exception_dec
Decorator to handle exceptions by logging errors to a specified file path.
@exception_dec('module_name', '/path/to/logfile.log')
def function_name(*args, **kwargs):
try:
# Function execution
return func(*args, **kwargs)
except Exception as err:
# Logs the error to the specified file path
log_error(module=exc_mod, file_path=exc_path, error=err)
logging.error(err)
repeat_on_error
Decorator to retry function execution a set number of times in case of exceptions.
@repeat_on_error(max_try=3, error_log='log/logfile.log', show_error=True)
def test_dummy(arg1:int):
return arg1/0
timeout_decorator
Decorator to set a timeout for a function.
from decoratorsutility.decorators import timeout_decorator
@timeout_decorator(timeout=5)
def my_function():
time.sleep(6) # Simulate a long-running function
return "Success!"
The Sphinx-generated documentation for PathUtils can be found here.
Feel free to contribute by submitting issues here.
FAQs
decorators utility
We found that decoratorsutility 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.