
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
A Django app extension of django-oauth-toolkit that implements scope based applications.
Mad Oauth2 app is an extension of django-oauth-toolkit that implements scopes and schemes in detail
Add "mad_oauth2" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'oauth2_provider',
'mad_oauth2',
...
]
REST_FRAMEWORK = {
...
"DEFAULT_PERMISSION_CLASSES": (
"oauth2_provider.contrib.rest_framework.TokenMatchesOASRequirements",
# OR
"oauth2_provider.contrib.rest_framework.TokenHasResourceScope",
),
'DEFAULT_THROTTLE_CLASSES': [
'mad_oauth2.throttling.BaseScopedRateThrottle'
],
...
}
OAUTH2_PROVIDER_APPLICATION_MODEL="mad_oauth2.Application"
OAUTH2_PROVIDER = {
"SCOPES_BACKEND_CLASS": "mad_oauth2.oauth2.ApplicationScopes",
"APPLICATION_ADMIN_CLASS": "mad_oauth2.admin.ApplicationAdminClass",
}
Run python manage.py migrate
to create mad_oauth2 models.
First add scopes and throttles from the admin, then mark the view with the respective scope. Changes will take effect once the code is deployed(redeployed/rebuild).
Run celery periodic task to clear expired tokens
mad_oauth2.tasks.removeExpiredTokens
this_view = "user"
throttle_scope = this_view
required_alternate_scopes = mad_oauth2.utils.requiredScopesForView(this_view)
Visit the official documentation for django-oauth-toolkit
for more details on this:
https://django-oauth-toolkit.readthedocs.io/en/latest/rest-framework/permissions.html
REST_FRAMEWORK = {
...
'DEFAULT_THROTTLE_CLASSES': [
'mad_oauth2.throttling.BaseScopedRateThrottle',
],
...
}
Visit the official documentation for djangorestframework
for more details this:
https://www.django-rest-framework.org/api-guide/throttling/#scopedratethrottle
FAQs
A Django app extension of django-oauth-toolkit that implements scope based applications.
We found that mad-oauth2 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.