idor
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "idor":https://skillpi.com/zh/skills/deepskill-9741ef5401dc71f384097f7ef969560fae239ea525786b62fde9e784076721a4。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/idor-0g40。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
面向 IDOR(不当水平权限访问)的对象授权专用技能,帮助 AI 代理高效完成相关任务。
介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 来源文档未说明。
- 输入和输出
- 来源文档未说明。
- 软件、账号及付费要求
- 来源文档未说明。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
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
- Every object fetch must be scoped to the owner or authorized principal — never fetch then check; scope the query directly
- 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
- Soft-deleted records: scoping to
user_idalone is not enough if soft-delete is used — also filterdeleted_at IS NULLto prevent accessing deleted objects - Nested resources:
/users/{userId}/orders/{orderId}— verify both that the authenticated user isuserIdAND that the order belongs to that user - 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 |
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供 IDOR 漏洞的完整检测与修复方案
- 覆盖多种编程语言的实际代码示例
- 包含 OWASP BOLA 标准对齐
亮点
- 触发描述清晰聚焦 IDOR 安全场景
- frontmatter 与外层 description 一致
亮点
- 逻辑结构清晰,从现象到解决方案层层递进
- 包含完整测试用例和审查清单
- frontmatter 完整,文档长度适中
亮点
- 所有建议符合行业安全最佳实践
- 代码示例参数正确,覆盖主要异常场景
- 强调所有权校验而非依赖 ID 类型
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
来源文档未说明。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。