跳到主内容
@wquguru
精选88Hacker News Best(web_list)行业动态多源精选 ×3

PingCAP TiDB Cloud遭大规模数据泄露,含客户SQL与源码

PingCap TiDB Leaks

原文
发到 X
推荐理由

AI基础设施厂商遭遇严重安全事件,暴露多租户隔离与加密实现缺陷,对使用TiDB Cloud的开发者有重要警示意义。

← FULCRUMSEC

THE LEAKS

泄露事件

PingCAP Inc. / TiDB Cloud • Distributed databases • 10.6 TB total exfiltration • 200 GB stage one release

PingCAP 公司 / TiDB Cloud • 分布式数据库 • 总计外泄 10.6 TB • 第一阶段发布 200 GB

DOWNLOADS

下载内容

10.6 TB total exfil • 4,901,203 files • 88 consecutive six-hourly exports of the production control plane, undetected • ~50 GCP storage buckets • a 533.8-million-row BigQuery warehouse • 180,046 tenant organisations • 403,262 unique emails • 115,308 plaintext customer API keys, 42,612 active • 20,645,574 customer SQL statements • 102,003,766 gateway connections • 5,036,738 customer server IPs • 377,446 Jira issues • 433,928 CRM contacts • 92 GB of tenant-tagged AWS cost data • 413 private source repos

总计外泄 10.6 TB • 4,901,203 个文件 • 连续 88 次每六小时导出一次生产控制平面数据,未被发现 • ~50 个 GCP 存储桶 • 一个包含 5.338 亿行数据的 BigQuery 仓库 • 180,046 个租户组织 • 403,262 个唯一邮箱地址 • 115,308 个明文客户 API 密钥(其中 42,612 个处于活跃状态)• 20,645,574 条客户 SQL 语句 • 102,003,766 个网关连接 • 5,036,738 个客户服务器 IP 地址 • 377,446 个 Jira 问题 • 433,928 个 CRM 联系人 • 92 GB 带有租户标签的 AWS 成本数据 • 413 个私有源代码仓库

Today we are making the PingCAP breach public. We possess the complete TiDB Cloud control plane, its billing and finance estate, its GCP storage estate and its AWS cost and billing estate, its Jira, its CRM, its analytics, its source code, and a four-year log of every connection every customer ever made to its product, from the IP addresses of their application servers.

今天,我们公开 PingCAP 被入侵的事件。我们拥有完整的 TiDB Cloud 控制平面、其计费与财务系统、GCP 存储系统以及 AWS 成本与计费系统、Jira、CRM、分析系统、源代码,以及过去四年中每位客户与其产品进行的所有连接的日志,包括其应用服务器的 IP 地址。

PingCAP sells TiDB Cloud, the managed version of the open-source TiDB database. Banks, game studios and e-commerce platforms hand over their production workloads; PingCAP operates the clusters in a shared, multi-tenant platform, and its entire business rests on the claim that doing so is safe and secure. The rest of this post is the evidence that it is neither.

PingCAP 销售 TiDB Cloud,这是开源 TiDB 数据库的管理版本。银行、游戏工作室和电商平台将他们的生产工作负载交由 PingCAP 处理;PingCAP 在一个共享的多租户平台上运营这些集群,其整个业务都建立在“这样做是安全可靠的”这一主张之上。本文的其余部分提供了证据,证明事实并非如此。

For one, they seem to have zero visibility into their own cloud services. This is sadly standard among companies we breach, who will invest millions in fancy EDRs but let half a thousand S3 buckets waltz out the door. But this is a cloud provider. It is horrendous and horrendously irresponsible to be seemingly incapable of detecting mass unsubtle compromise and exfiltration of each of their cloud services: AWS, GCP, Atlassian / Jira, Azure. We continued exfiltration over nearly two months, topping up regularly after the initial ~8 terabyte exfil. We even stood up a replication feed of their own control-plane database using credentials committed in their own repositories — GCP service-account keys and an Azure service principal — and let their infrastructure deliver it to us. Every six hours, for the last twenty-two days of the campaign, from 8 September to 30 September, that pipeline faithfully re-exported every table of the operational heart of TiDB Cloud — tenants, users, API keys, cluster credentials, changefeeds, migrations — and pushed it out. Eighty-eight consecutive exports, not one detection event. The last ran at 06:02 UTC on 30 September. The control-plane data it carried is in the stage-one release.

首先,他们似乎对自己的云服务完全缺乏可见性。这在我们攻破的公司中令人遗憾地成为常态:这些公司愿意在昂贵的 EDR(端点检测与响应)系统上投入数百万美元,却任由数百个 S3 存储桶随意流出。但这是一个云提供商。显然无法检测到其各项云服务(AWS、GCP、Atlassian / Jira、Azure)遭受的大规模且不隐蔽的入侵和数据外泄,这是极其糟糕且极度不负责任的行为。我们在近两个月的时间里持续进行数据外泄,并在初始约 8 TB 的外泄后定期补充。我们甚至利用在其自身仓库中提交的凭据——GCP 服务账号密钥和 Azure 服务主体——搭建了他们控制平面数据库的复制源,并让他们的基础设施将数据传送给我们。在活动的最后二十二天里,从 9 月 8 日到 9 月 30 日,每六小时一次,该管道忠实地重新导出了 TiDB Cloud 运营核心的每一张表——租户、用户、API 密钥、集群凭据、变更流、迁移记录——并将其推送出去。连续八十八次导出,未触发任何检测事件。最后一次运行于 9 月 30 日 UTC 时间 06:02。它携带的控制平面数据已在第一阶段发布中公开。

What We Took

我们获取了什么

  • The control plane. metadb, replicated in full: 180,046 tenant organisations, 292,276 user records with 166,108 real names, 403,262 unique emails, 388,861 projects, 3,448,054 serverless clusters, 16,299 dedicated clusters, 115,308 console API keypairs stored in plaintext (42,612 active; the newest was minted at 04:46 on 30 September, hours before we closed the tap), 1,809 external database endpoints from customer migration jobs — root and admin accounts on customer MySQL/Aurora hosts — plus 290 customer AWS account IDs and 85 GCP project IDs from VPC peering records.
  • The customers' own SQL. 20,645,574 raw SQL statements captured from the SQL Editor and Chat2Query — the application schemas, table designs and business logic of thousands of tenants, keyed by org, project and cluster ID. One statement creates a table of medical professionals (usuario, nombre_usuario, contrasena); another inserts a Brazilian clinic's patient roster. This is the contents of customer databases, captured by the product itself and shipped to us by PingCAP's own pipeline.
  • The targeting map. The gateway access logs are the installed-base directory of a database company: every customer's connection volume, their app-server IP addresses, their client programs (Rails 0.46M connections, ProxySQL, MySQL Workbench, langgenius/dify), their cluster IDs. Anyone planning further access to TiDB Cloud customers starts here. All 23,651 daily files are in 09_gateway_logs.tar.gz.
  • The money. The CUR corpus with resource_tags_user_tenant turns PingCAP's cost-to-serve per customer into a spreadsheet join: 57 months of AWS spend totalling $107,195,238.42, EDP discount −$10,362,705.51 and private rates −$8,829,018.11 (~47% off list), us-east-1 cross-AZ transfer alone at $16,509,714.87. Combine with the finance-DB snapshots (per-tenant net fees, monthly_cloud_order, the AR table, dbaas_billing at 8.8M rows) and the ARR writer logs, and the gross margin of TiDB Cloud, per named customer, per product family, is a SQL query.
  • The commercial book. HubSpot: 433,928 contacts, 191,187 companies, deals nominally worth $552M — Wetech $74.7M, PayPay $45.2M, Atlassian $25.8M, SBI $20.2M, AEON $10.7M, TOPPAN $9.7M. Stripe: all 8,428 paying tenants, livemode, with 8,301 tenant IDs joined to Stripe accounts. NetSuite revenue ledgers for 584 named customers. AWS Marketplace: 861 buyer street addresses, 48,991 subscriber agreements. The China ledger: 12,262 revenue-recognition rows totalling ¥353.1M, with Bank of China, the Ministry of Science and Technology and China Life among the customers.
  • The source code. 413 repositories. The billing engine that trusts unverified X-ACCOUNT-USER-ID headers. The account service where admin is a tenant ID and impersonation bypasses org checks with owner role. The shared crypto library, pkgv2: AES-CBC with the IV derived from the key prefix — a static IV — instantiated with a single server-wide SaltSecret; every encrypted customer downstream-database password in the platform is one config secret from plaintext.
  • The identity graph. 13,620,173 GA4 device identifiers over 108,871,828 events; the cloud_users crosswalk (290,458 rows) that joins hashed user IDs to emails and employer tenant IDs; 2,895,030 rows linking logged-in identities to cookie trails; Mixpanel exports with 3,552 full named profiles; 24,932 personal emails with LinkedIn and GitHub profiles from the reo.dev developer-intelligence graph PingCAP purchased — Tencent's 3,327 most active engineers, Huawei's 2,726, ByteDance's 2,475, ranked by their propensity to buy.
  • 控制平面。metadb 完整复制:180,046 个租户组织,292,276 条用户记录(包含 166,108 个真实姓名),403,262 个唯一邮箱,388,861 个项目,3,448,054 个无服务器集群,16,299 个专用集群,115,308 对以明文存储的控制台 API 密钥对(其中 42,612 个处于活跃状态;最新的一个于 9 月 30 日 UTC 时间 04:46 生成,距离我们关闭数据流出通道仅有数小时),来自客户迁移作业的 1,809 个外部数据库端点——即客户 MySQL/Aurora 主机上的 root 和管理员账户——以及来自 VPC 对等连接记录的 290 个客户 AWS 账户 ID 和 85 个 GCP 项目 ID。
  • 客户自己的 SQL。从 SQL Editor 和 Chat2Query 捕获了 20,645,574 条原始 SQL 语句——数千个租户的应用程序架构、表设计和业务逻辑,按组织、项目和集群 ID 索引。一条语句创建了一个医疗专业人员表(usuario, nombre_usuario, contrasena);另一条语句插入了巴西一家诊所的患者名单。这些是客户数据库的内容,由产品本身捕获,并通过 PingCAP 自身的管道发送给我们。
  • 目标客户地图。网关访问日志是数据库公司的已安装基础目录:每个客户的连接量、应用服务器 IP 地址、客户端程序(Rails 0.46M 连接、ProxySQL、MySQL Workbench、langgenius/dify)、集群 ID。任何计划进一步接触 TiDB Cloud 客户的人都要从这里开始。所有 23,651 个每日文件都在 09_gateway_logs.tar.gz 中。
  • 资金数据。带有 resource_tags_user_tenant 的 CUR 语料库将 PingCAP 每位客户的服务成本转化为电子表格关联:57 个月的 AWS 支出总计 $107,195,238.42,EDP 折扣 −$10,362,705.51 以及私有费率 −$8,829,018.11(约为列表价的 47% 折扣),仅 us-east-1 跨可用区传输就达 $16,509,714.87。结合 finance-DB 快照(按租户净费用、monthly_cloud_order、AR 表、dbaas_billing 共 880 万行)和 ARR 写入器日志,TiDB Cloud 的毛利率——按命名客户、按产品线划分——就是一个 SQL 查询。
  • 商业账本。HubSpot:433,928 个联系人,191,187 家公司,名义交易价值 5.52 亿美元 —— Wetech 7,470 万美元,PayPay 4,520 万美元,Atlassian 2,580 万美元,SBI 2,020 万美元,AEON 1,070 万美元,TOPPAN 970 万美元。Stripe:全部 8,428 个付费租户,livemode 模式,其中 8,301 个租户 ID 与 Stripe 账户关联。NetSuite 收入账簿涵盖 584 个命名客户。AWS Marketplace:861 个买家街道地址,48,991 份订阅协议。中国账本:12,262 行收入确认记录,总计 ¥3.531 亿元,客户包括中国银行、科学技术部和中国人寿。
  • 源代码。413 个代码仓库。信任未经验证的 X-ACCOUNT-USER-ID 标头的计费引擎。管理员即租户 ID 且模拟操作可绕过拥有者角色的组织检查的账户服务。共享加密库 pkgv2:使用 AES-CBC 算法,IV 由密钥前缀派生——这是一个静态 IV——并使用单一的全局 SaltSecret 实例化;平台中每个下游数据库密码的加密客户数据都源自一个明文配置密钥。
  • 身份图谱。108,871,828 个事件中的 13,620,173 个 GA4 设备标识符;cloud_users 交叉对照表(290,458 行),将哈希用户 ID 与电子邮件及雇主租户 ID 关联;2,895,030 行将登录身份与 Cookie 轨迹关联的数据;Mixpanel 导出包含 3,552 个完整命名画像;24,932 个个人电子邮件地址,附带来自 PingCAP 收购的 reo.dev 开发者情报图谱的 LinkedIn 和 GitHub 资料——腾讯的 3,327 名最活跃工程师、华为的 2,726 名、字节跳动的 2,475 名,按其购买倾向排名。

The Customers in the Records

记录中的客户

The tenant IDs are not anonymous. PingCAP's own ops audit trail maps them:

租户 ID 并非匿名。PingCAP 自身的运维审计轨迹对它们进行了映射:

CustomerTenant ID / Detail
Booking.comtenant 1372813089189081313
Shopeetenant 1372813089191241283
CAPCOM CO., LTDtenant 1372813089188871292, TiDB v6.1.1, ap-northeast-1
Colopltenant 1326455380288475136, TiDB v6.1.0
TOPPAN INC.prod-1372813089204501289, aws-ap-northeast-1
Catalyst Softwareprod-1372813089188151289, aws-us-east-1
SB Payment Serviceprod-1372813089206331321, aws-ap-northeast-1
客户租户 ID / 详情
Booking.comtenant 1372813089189081313
Shopeetenant 1372813089191241283
CAPCOM CO., LTDtenant 1372813089188871292, TiDB v6.1.1, ap-northeast-1
Colopltenant 1326455380288475136, TiDB v6.1.0
TOPPAN INC.prod-1372813089204501289, aws-ap-northeast-1
Catalyst Softwareprod-1372813089188151289, aws-us-east-1
SB Payment Serviceprod-1372813089206331321, aws-ap-northeast-1

…plus, in the same 42-organisation table and the 94-entry billing dictionary that ships in the eda_service repository: Mercari, PayPay, Fujitsu, SoftBank, DMM, AEON, Square Enix, Konami, BANDAI NAMCO, Delhivery, Flipkart, Quincus, Nylas, Airbnb, Pinterest, Databricks, bitget, Pionex, DigiPlus, NFTscan, Baidu, SES-imagotag, Persona, Transsion, ZOZO, gumi, iret, Classmethod, Wetech, Atlassian, Cygames, SBI, LINE, Chainbase, PatSnap. Their VPC CIDRs are included; their cluster versions and endpoint hostnames are included; for the unlucky ones pasted into support tickets, so are their credentials.

……此外,在 eda_service 仓库随附的同一份包含 42 个组织的表格以及包含 94 条条目的计费字典中:Mercari、PayPay、富士通、软银、DMM、AEON、Square Enix、Konami、BANDAI NAMCO、Delhivery、Flipkart、Quincus、Nylas、Airbnb、Pinterest、Databricks、bitget、Pionex、DigiPlus、NFTscan、百度、SES-imagotag、Persona、传音、ZOZO、gumi、iret、Classmethod、Wetech、Atlassian、Cygames、SBI、LINE、Chainbase、PatSnap。它们的 VPC CIDR 被包含在内;它们的集群版本和端点主机名也被包含在内;对于那些不幸被粘贴到支持工单中的用户,其凭据也同样被包含在内。

The Warning Was Already in Jira

警告早已存在于 Jira 中

PingCAP's security team wrote down exactly what was wrong with the multi-tenant isolation of their own product in 2022. SECURITY-22, from the internal security tracker, in their own words:

PingCAP 的安全团队在 2022 年详细记录了其自身产品的多租户隔离存在的具体问题。SECURITY-22 来自内部安全追踪器,原文如下:

Summary: "The root password of the cluster can be reset unconditionally"

摘要:“集群的 root 密码可以被无条件重置”

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →