Skip to content

fix: deep-copy SSL key to prevent use-after-free (backport de Artemis #64) - #1

Merged
unjordi merged 1 commit into
developfrom
fix/ssl-key-use-after-free
Jun 28, 2026
Merged

unjordi merged 1 commit into
developfrom
fix/ssl-key-use-after-free

Conversation

@unjordi

@unjordi unjordi commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Backport del PR wjbeckett/artemis#64 de @7ayun (autoría preservada vía cherry-pick).

Qué arregla

IdentityManager::getSslKey() usaba QByteArray::fromRawData(), que crea una copia superficial apuntando al buffer del BIO. Tras BIO_free(bio) el buffer queda liberado y m_CachedSslKey se queda con un puntero colgante → use-after-free.

El fix reemplaza fromRawData() por el constructor QByteArray() (copia profunda) antes de liberar el BIO.

Procedencia

Archivo: app/backend/identitymanager.cpp (1 línea).

🤖 Generated with Claude Code

QByteArray::fromRawData() creates a shallow copy that references the
BIO buffer directly. After BIO_free(bio) is called, the buffer is
freed, leaving m_CachedSslKey holding a dangling pointer.

Replace fromRawData() with QByteArray() constructor to perform a deep
copy before the BIO is freed.

This issue was fixed in upstream moonlight-qt in commit 1eb76bb.

(cherry picked from commit ac6165b)
@unjordi
unjordi merged commit 1d89db4 into develop Jun 28, 2026
@unjordi
unjordi deleted the fix/ssl-key-use-after-free branch June 28, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants