Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
This is a small Python package that offers fast runtime inspection similar to that of inspect
module in Python. To install, simply do
::
pip install uinspect
The following benchmark is generated from running the scripts in benchmark/
.
+-----------------+-----------------------------------------------------+------------------------------+---------+---------+--------------+
| Task name | uinspect method1 | uinspect method2 | inspect | speedup | Cost (us/op) |
+=================+=====================================================+==============================+=========+=========+==============+
| Source location | uinspect.get_location()
- 0.21s | uinspect.Frame()
- 0.48s | 16.43s | 79.7x | 0.21 us/op |
+-----------------+-----------------------------------------------------+------------------------------+---------+---------+--------------+
| Locals | uinspect.Frame().locals
- 0.99s | N/A | 0.82s | 0.82x | 0.99 us/op |
+-----------------+-----------------------------------------------------+------------------------------+---------+---------+--------------+
| Locals diff | uinspect.Frame(2).collect_vars()
- 2.94s | N/A | 1.20s | 0.41x | 2.94 us/op |
+-----------------+-----------------------------------------------------+------------------------------+---------+---------+--------------+
| Frame walking | uinspect.FrameWalker({}).get_location()
- 1.45s | N/A | 52.27s | 35.9x | 1.46 us/op |
+-----------------+-----------------------------------------------------+------------------------------+---------+---------+--------------+
It turns out that the uinspect
does not speed up the local variable calculation. This is because we have to run an expensive Python C API call regardless of whether it’s uinspect
or inspect
. As a result, the overhead is caused by the fact that uinspect
needs to convert Python object to C++ object.
The lesson is to use inspect
module for any local variables related manipulation since it’s faster, but use uinspect
to obtain source location.
::
git clone https://github.com/Kuree/uinspect.git cd uinspect git submodule update --init python setup.py install
FAQs
Ultra-fast inspect functions for Python
We found that uinspect 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.