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.
CORS support for bareASGI (read the docs)
Simply create the CORSMiddleware
class and put is as the first middleware.
import json
import uvicorn
from bareasgi import (
Application,
text_reader,
text_writer
)
from bareasgi_cors import CORSMiddleware
async def get_info(request):
text = json.dumps(request.info)
return HttpResponse(200, [(b'content-type', b'application/json')], text_writer(text))
async def set_info(request):
text = await text_reader(request.body)
data = json.loads(text)
request.info.update(data)
return HttpResponse(204)
# Create the CORS middleware class
cors_middleware = CORSMiddleware()
# Use the CORS middleware as the first middleware.
app = Application(info={'name': 'Michael Caine'}, middlewares=[cors_middleware])
app.http_router.add({'GET'}, '/info', get_info)
app.http_router.add({'POST', 'OPTIONS'}, '/info', set_info)
uvicorn.run(app, port=9010)
In the above example an OPTION method is included with the POST. This is always required with a POST as a browser will try first with an OPTION.
FAQs
CORS support for bareasgi
We found that bareasgi-cors 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.