mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
Authorization analysis logic improvements (#61)
This commit is contained in:
parent
3c89bddbf2
commit
40995e45e7
55 changed files with 4193 additions and 134 deletions
|
|
@ -0,0 +1,20 @@
|
|||
# py-auth-vuln-002: helper takes a user-supplied id (`project_id`)
|
||||
# and queries by it without any preceding ownership/membership check.
|
||||
# This is the vulnerable counterpart to
|
||||
# safe_django_orm_caller_scoped_entity.py — same Django ORM shape, but
|
||||
# the param is an *id-like user input*, not a scope-entity object, so
|
||||
# the caller-scope-entity exemption must not apply.
|
||||
#
|
||||
# Pinned to keep recall on the missing_ownership_check rule.
|
||||
|
||||
|
||||
class Project:
|
||||
pass
|
||||
|
||||
|
||||
def get_project(request, project_id):
|
||||
return Project.objects.filter(id=project_id).first()
|
||||
|
||||
|
||||
def delete_project(request, project_id):
|
||||
Project.objects.filter(id=project_id).delete()
|
||||
Loading…
Add table
Add a link
Reference in a new issue