본문으로 건너뛰기
Skillpedia
보안48k · #4468

django-access-review

하는 일

이 도구는 Django나 DRF로 만든 시스템에서 권한이 없는 사용자가 다른 사용자의 데이터를 보거나, 수정하거나, 삭제할 수 있는지 확인하도록 돕습니다. 코드에서 권한이 어떻게 작동하는지 살펴보며 보안 결함을 찾습니다.

사용하는 경우

  • ✓Django/DRF 시스템의 보안 코드를 검토할 때.
  • ✓사용자가 다른 사람의 데이터를 보거나 바꿀 수 있다고 의심될 때.
  • ✓특정 정보에 권한 있는 사람만 접근하도록 확인하고 싶을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/django-access-review/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/django-access-review/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“일반 사용자가 문서 시스템에서 다른 사용자의 데이터를 볼 수 있는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 코드를 분석해 권한이 어떻게 확인되는지 이해하고, 데이터 흐름을 추적하면서 접근 확인이 부적절하게 이루어지는 지점을 찾습니다. 일반적인 오류 패턴을 검색하기보다 시스템의 고유한 로직을 이해하는 데 초점을 맞춥니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

<!-- Reference material based on OWASP Cheat Sheet Series (CC BY-SA 4.0) https://cheatsheetseries.owasp.org/ -->

Django Access Control & IDOR Review

Find access control vulnerabilities by investigating how the codebase answers one question:

Can User A access, modify, or delete User B's data?

When to Use

  • You need to review Django or DRF code for access control gaps, IDOR risk, or object-level authorization failures.
  • The task involves confirming whether one user can access, modify, or delete another user's data.
  • You want an investigation-driven authorization review instead of generic pattern matching.

Philosophy: Investigation Over Pattern Matching

Do NOT scan for predefined vulnerable patterns. Instead:

  1. Understand how authorization works in THIS codebase
  2. Ask questions about specific data flows
  3. Trace code to find where (or if) access checks happen
  4. Report only what you've confirmed through investigation

Every codebase implements authorization differently. Your job is to understand this specific implementation, then find gaps.


Phase 1: Understand the Authorization Model

Before looking for bugs, answer these questions about the codebase:

How is authorization enforced?

Research the codebase to find:

□ Where are permission checks implemented?
  - Decorators? (@login_required, @permission_required, custom?)
  - Middleware? (TenantMiddleware, AuthorizationMiddleware?)
  - Base classes? (BaseAPIView, TenantScopedViewSet?)
  - Permission classes? (DRF permission_classes?)
  - Custom mixins? (OwnershipMixin, TenantMixin?)

□ How are queries scoped?
  - Custom managers? (TenantManager, UserScopedManager?)
  - get_queryset() overrides?
  - Middleware that sets query context?

□ What's the ownership model?
  - Single user ownership? (document.owner_id)
  - Organization/tenant ownership? (document.organization_id)
  - Hierarchical? (org -> team -> user -> resource)
  - Role-based within context? (org admin vs member)

Investigation commands

# Find how auth is typically done
grep -rn "permission_classes\|@login_required\|@permission_required" --include="*.py" | head -20

# Find base classes that views inherit from
grep -rn "class Base.*View\|class.*Mixin.*:" --include="*.py" | head -20

# Find custom managers
grep -rn "class.*Manager\|def get_queryset" --include="*.py" | head -20

# Find ownership fields on models
grep -rn "owner\|user_id\|organization\|tenant" --include="models.py" | head -30

Do not proceed until you understand the authorization model.


Phase 2: Map the Attack Surface

Identify endpoints that handle user-specific data:

What resources exist?

□ What models contain user data?
□ Which have ownership fields (owner_id, user_id, organization_id)?
□ Which are accessed via ID in URLs or request bodies?

What operations are exposed?

For each resource, map:

  • List endpoints - what data is returned?
  • Detail/retrieve endpoints - how is the object fetched?
  • Create endpoints - who sets the owner?
  • Update endpoints - can users modify others' data?
  • Delete endpoints - can users delete others' data?
  • Custom actions - what do they access?

Phase 3: Ask Questions and Investigate

For each endpoint that handles user data, ask:

The Core Question

"If I'm User A and I know the ID of User B's resource, can I access it?"

Trace the code to answer this:

1. Where does the resource ID enter the system?
   - URL path: /api/documents/{id}/
   - Query param: ?document_id=123
   - Request body: {"document_id": 123}

2. Where is that ID used to fetch data?
   - Find the ORM query or database call

3. Between (1) and (2), what checks exist?
   - Is the query scoped to current user?
   - Is there an explicit ownership check?
   - Is there a permission check on the object?
   - Does a base class or mixin enforce access?

4. If you can't find a check, is there one you missed?
   - Check parent classes
   - Check middleware
   - Check managers
   - Check decorators at URL level

Follow-Up Questions

□ For list endpoints: Does the query filter to user's data, or return everything?

□ For create endpoints: Who sets the owner - the server or the request?

□ For bulk operations: Are they scoped to user's data?

□ For related resources: If I can access a document, can I access its comments?
  What if the document belongs to someone else?


…
자주 묻는 질문

IDOR란 무엇인가요?

IDOR는 ‘안전하지 않은 직접 객체 참조(Insecure Direct Object Reference)’의 약자입니다. URL이나 요청에 있는 번호 같은 식별자를 바꾸는 것만으로, 사용자가 보면 안 되는 데이터나 파일에 접근할 수 있는 보안 취약점입니다.

이 도구는 어떻게 결함을 찾나요?

자동으로 오류를 검색하지 않습니다. 대신 누가 무엇을 할 수 있는지 시스템이 어떻게 확인하는지 수동으로 조사하도록 안내합니다. 코드의 로직을 따라가며 접근 확인이 빠져 있거나 실패하는 지점을 찾습니다.

이 도구를 쓰려면 Django 프로그래밍을 알아야 하나요?

데이터 처리와 권한에 관한 Django의 기본 작동 방식을 어느 정도 이해하면 도움이 됩니다. 도구가 조사를 안내하지만, 최종 코드 분석은 필요합니다.

상세 정보

작성자의 원본 설명

Use when reviewing Django or DRF access control: trace authorization flows, IDOR risks, object permissions, query scoping and tenant isolation before proposing a verified fix.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4468
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬