security(sso): apply mapped-domain token policy to admin-bar magic links

未关闭
#2,125 5 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@superdav42 已经在做这个了。

开始于 2026年11月20日。

  • #2129 来自 @superdav42 —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

auto-dispatch origin:interactive status:in-review tier:standard

Problem

Follow-up to GHSA-qh2w-5cww-9wxr (fixed in 2.19.0 by #2119). Admin-bar magic links still send network admins to customer mapped domains with a login token in the URL. Whoever controls the domain's DNS can capture the token and replay it for a network admin session.

An attacker cannot force this: the link needs a nonce-protected click by the admin. But the customer still receives a network-wide credential whenever an admin visits their site this way.

Files

  • inc/sso/class-admin-bar-magic-links.php: around line 184, access is allowed for is_super_admin() || is_user_member_of_blog().
  • inc/sso/class-magic-link.php: verify_user_site_access() (around line 800) also allows any super admin on any site.

Reference pattern

Use the host policy added in #2119, SSO::can_use_cookie_less_sso_token() in inc/sso/class-sso.php:

  • Hosts the network owner controls (network domain, its subdomains, main-site domains): no change.
  • Customer mapped domains: no token for users with is_super_admin() / manage_network. Non-admins must be members of the site.
  • Filter wu_sso_allow_cookie_less_token lets operators relax it.

Options: make that check reusable (public or a shared helper) and apply it when magic links are generated and redeemed. When a network admin targets a customer mapped domain, send them to that domain's login page instead of minting a token.

Verification

  • vendor/bin/phpunit --filter Magic_Link, plus the admin-bar magic-link tests, pass.
  • New test: a super admin requesting a magic link for a subsite with an active mapped domain gets no token. Fixture pattern: create_customer_mapped_site() in tests/WP_Ultimo/SSO/SSO_Coverage_Test.php.
  • Magic links on network subdomains, and for site members, still work.
Files Scope
  • EDIT: inc/sso/class-admin-bar-magic-links.php
  • EDIT: inc/sso/class-magic-link.php
  • EDIT: inc/sso/class-sso.php
  • EDIT: tests/WP_Ultimo/SSO/SSO_Coverage_Test.php

aidevops.sh v3.39.189 plugin for OpenCode

主要语言
PHP
星标
219
派生
88
平均合并
1 天 7 小时
30 天内合并 PR
58

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Ultimate-Multisite/ultimate-multisite 的其他 Issue

查看 Ultimate-Multisite/ultimate-multisite 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。