Skip to content

fix(security): CORS 默认正则匹配任意 Vercel 子域名 #202

Description

@xiaocheny214

问题描述

文件: backend/packages/app/src/windup_app/bootstrap/app.py:58

return os.getenv("WINDUP_CORS_ORIGIN_REGEX", r"https://.*\.vercel\.app").strip() or None

默认 CORS origin 正则 https://.*\.vercel\.app 匹配任意 Vercel 子域名,包括攻击者控制的如 https://evil.vercel.app。攻击者可在 Vercel 部署恶意页面,发起带凭据的跨域请求到 API。

建议修复

  1. 将默认正则限制到团队的 Vercel 项目域名(如 https://windup-.*\.vercel\.app)。
  2. 或者默认设为 None,不允许任何跨域,强制用户显式配置。

影响

  • 严重程度: Medium-High
  • 攻击者可从任意 Vercel 托管站点发起带凭据的 CSRF/数据窃取请求

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1优先级 P1(次级)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions