idor

A specialized skill for object authorization related to IDOR (insecure direct object references) to help AI agents efficiently perform related tasks.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "idor" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9741ef5401dc71f384097f7ef969560fae239ea525786b62fde9e784076721a4. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/idor-0g40 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A specialized skill for object authorization related to IDOR (insecure direct object references) to help AI agents efficiently perform related tasks.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
IDOR — detection, authorization enforcement, ID strategy.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: idor
description: IDOR — detection, authorization enforcement, ID strategy.

IDOR — Insecure Direct Object Reference

IDOR occurs when an application uses user-controlled input to access objects directly without verifying the requesting user has permission to access that specific object.


What It Looks Like

# Attacker changes 42 → 43 and gets another user's order
GET /api/orders/43
Authorization: Bearer <attacker-token>

The endpoint fetches Order::find(43) without checking order.user_id === currentUser.id.

IDOR is not just IDs. Any reference to an object that can be guessed or enumerated is vulnerable: filenames in URLs, email addresses as keys, UUIDs if predictable or leaked.


Detection Patterns

Flag these patterns in code review:

// BAD — no ownership check
$order = Order::find($request->id);
return $order;

// GOOD — scope query to authenticated user
$order = Order::where('id', $request->id)
              ->where('user_id', auth()->id())
              ->firstOrFail();
# BAD
order = Order.objects.get(pk=pk)

# GOOD
order = Order.objects.get(pk=pk, user=request.user)
// BAD
const invoice = await Invoice.findByPk(req.params.id)

// GOOD
const invoice = await Invoice.findOne({
  where: { id: req.params.id, userId: req.user.id }
})

Authorization Enforcement Rules

  1. Every object fetch must be scoped to the owner or authorized principal — never fetch then check; scope the query directly
  2. Role checks are not substitutes for ownership checks — an admin role grants broad access by definition; a regular user with a valid token must still be scoped
  3. Soft-deleted records: scoping to user_id alone is not enough if soft-delete is used — also filter deleted_at IS NULL to prevent accessing deleted objects
  4. Nested resources: /users/{userId}/orders/{orderId} — verify both that the authenticated user is userId AND that the order belongs to that user
  5. Bulk endpoints: /orders?ids[]=1&ids[]=2 — apply ownership filter on the entire set; never return a subset silently (either all authorized or error)

ID Strategy

ID type IDOR risk Recommendation
Sequential integer (1, 2, 3) HIGH — trivially enumerable Use UUIDs for external-facing IDs
UUID v4 MEDIUM — not guessable, but still must enforce ownership Always enforce ownership; UUIDs are not access control
UUID v7 (time-ordered) MEDIUM — sortable; leaks creation time Acceptable for most use cases; enforce ownership
Slugs MEDIUM — guessable if predictable pattern Enforce ownership; avoid slug = user-controlled string
Indirect reference (hash map on server) LOW Good pattern; map user-visible token → real ID server-side

UUIDs prevent enumeration but do NOT prevent IDOR. A leaked UUID (from a URL, log, or referrer header) is still exploitable without ownership checks.


BOLA vs IDOR

These terms overlap — OWASP API Security Top 10 uses BOLA (Broken Object-Level Authorization):

  • IDOR = the vulnerability (referencing objects without authorization)
  • BOLA = the API-specific framing from OWASP API Security 2023 (#1)

Same root cause, same fix. When auditing APIs, use the BOLA framing from the security-checklist skill.


Test Cases (Required)

For every endpoint that accepts an object ID, write these tests:

Test Expected result
Owner accesses their own object 200 OK
Authenticated user accesses another user's object 403 Forbidden or 404 Not Found
Unauthenticated user accesses any object 401 Unauthorized
Soft-deleted object accessed by owner 404 Not Found
Bulk endpoint with mixed owned/unowned IDs 403 or only return owned subset with explicit error
// Example test (framework-agnostic)
it('returns 403 when user accesses another users order', async () => {
  const other = await createUser()
  const order = await createOrder({ userId: other.id })

  const res = await request(app)
    .get(`/api/orders/${order.id}`)
    .set('Authorization', `Bearer ${currentUser.token}`)

  expect(res.status).toBe(403)
})

Review Checklist

Item Severity
Object fetched without user scope CRITICAL
Sequential IDs on external-facing resource endpoints HIGH
Role check present but ownership check absent HIGH
Nested resource route missing parent ownership check HIGH
Bulk endpoint returns unauthorized objects silently HIGH
Soft-deleted records accessible via ID MEDIUM
No IDOR test cases for new endpoints MEDIUM

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 IDOR 漏洞的完整检测与修复方案
  • 覆盖多种编程语言的实际代码示例
  • 包含 OWASP BOLA 标准对齐
Trigger Precision90/100

Highlights

  • 触发描述清晰聚焦 IDOR 安全场景
  • frontmatter 与外层 description 一致
Structure and Standards95/100

Highlights

  • 逻辑结构清晰,从现象到解决方案层层递进
  • 包含完整测试用例和审查清单
  • frontmatter 完整,文档长度适中
Execution Reliability90/100

Highlights

  • 所有建议符合行业安全最佳实践
  • 代码示例参数正确,覆盖主要异常场景
  • 强调所有权校验而非依赖 ID 类型
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.