Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • H holdingk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • knitting
  • holdingk
  • Merge requests
  • !1622

Merged
Created Sep 15, 2026 by wangzp@wangzpOwner0 of 3 tasks completed0/3 tasks

H-10:CORS Origin 白名单,去掉通配带凭证

  • Overview 0
  • Commits 24
  • Changes 86

holdingk-web CORS 去掉 * + credentials;Origin 走配置白名单。叠在 H-9 上。

Summary

  • 删除 ALLOW_ORIGIN="*" + setAllowCredentials(true) + addAllowedOriginPattern("*")
  • 新增 holdingk.cors.allowed-origins / allow-credentials:空列表只允许同源;配置里的 * 丢弃并打 warn;credentials 仅对剩余白名单开启(默认 false)
  • application-local.yaml 仅放开 http://localhost:3100 与 127.0.0.1:3100;不升 config-repo、不改前端

Test plan

  • CorsConfigurationFactoryTest(恶意 Origin 不反射、精确/子域白名单、* 丢弃)
  • OPTIONS Origin: https://evil.example 不回该 Origin、无 credentials true
  • 同源 /basic-api 登录与业务接口不回归

无 Maven 升版、无 Flyway、无前端仓。方案:钉钉 H-10

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: hotfix/h10-cors-origin-whitelist