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 library provides a lazy interface for parsing objects from dictionaries. During the parsing, it saves the raw data inside the object and parses each field on demand.
poetry
poetry add lazy-model
pip
pip install lazy-model
from lazy_model import LazyModel
from pydantic import validator
class Sample(LazyModel):
i: int
s: str
@validator("s")
def s_upper(cls, v):
return v.upper()
obj = Sample.lazy_parse({"i": "10", "s": "test"})
# at this point the data is stored in a raw format inside the object
print(obj.__dict__)
# >>> {'i': NAO, 's': NAO}
# NAO - Not An Object. It shows that the field was not parsed yet.
print(obj.s)
# >>> TEST
# Custom validator works during lazy parsing
print(obj.__dict__)
# >>> {'i': NAO, 's': 'TEST'}
# The `s` field was already parsed by this step
print(obj.i, type(obj.i))
# >>> 10 <class 'int'>
# It converted `10` from string to int based on the annotations
print(obj.__dict__)
# >>> {'i': 10, 's': 'TEST'}
# Everything was parsed
FAQs
Unknown package
We found that lazy-model 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.