> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/web/access-control/insecure-direct-references-to-objects.md).

# 不安全的对象直接引用

### 不安全的直接对象引用

**实验目标：** 用户聊天记录直接存储在服务器文件系统上，并通过静态 URL 访问。目标是找到该用户的密码 **carlos** 然后登录他的账户。

<figure><img src="/files/29be3cb4387e1475d1dee025976493cfbfce6639" alt="" width="563"><figcaption></figcaption></figure>

观察到一个电子邮件功能，其中有一个通过一个下载聊天转录的选项 **GET** 请求。

<figure><img src="/files/77be2a7df9e93411055d16b36b0de29b9d9cdd36" alt=""><figcaption></figcaption></figure>

URL 如下：

```
/download-transcript/1.txt
```

只需更改 URL 中的文件标识符，就可以在没有任何保护的情况下访问其他用户的转录内容。例如：

<figure><img src="/files/024f79a6e40dd5d31d23c46bc5a072f855cc2992" alt=""><figcaption></figcaption></figure>

该文件显示了一段对话的内容，其中包含 **carlos 的密码**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/zh/web/access-control/insecure-direct-references-to-objects.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
