TOTP secret disclosed to third‑party QR service
-
During setup, the plugin builds an otpauth URI that includes the user’s TOTP secret, then generates a QR code using a remote service. The full otpauth URI (including the secret) is sent to https://api.qrserver.com/v1/create-qr-code/ as a GET parameter.
Technical:
$display=$this->user->user_login;
$name=parse_url(get_bloginfo('wpurl'),PHP_URL_HOST);
$display=$name.'%3A'.$display;
$data=sprintf("otpauth://totp/%s?secret=%s&issuer=%s",$display,$secret,$name);and then
function getQrCodeUrl($data, $size=144){
$data=urlencode($data);
$qr_url=sprintf('https://api.qrserver.com/v1/create-qr-code/?size=%1$sx%1$s&data=%2$s',$size,$data);
return $qr_url;
}Impact
- The TOTP secret is disclosed to a third party (the QR provider). Anyone with access to those logs can generate valid 2FA codes and bypass 2FA for that user. Even over HTTPS, the confidentiality breach exists at the remote endpoint.
- If the setup page is loaded, the secret is transmitted externally. For existing users, reconfiguring or re‑enrolling can re‑expose secrets.
CVSS v3.1: 8.2 (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N)
PoC (lab)
- Enable 2SV and visit the setup page. Inspect the network: requests to https://api.qrserver.com/v1/create-qr-code/?size=…&data=otpauth://totp/…secret=<SECRET>&issuer=<SITE> contain the secret in plaintext query string.
Fix
- Render QR codes locally (server-side image or client-side library) without sending the secret to external services.
- Do not embed secrets in third‑party requests.
The topic ‘TOTP secret disclosed to third‑party QR service’ is closed to new replies.