rust-gjk / ChatApp

Naše chatovací aplikace
0 stars 0 forks source link

Don't use from_utf8_unchecked on network data #1

Open CodesInChaos opened 6 years ago

CodesInChaos commented 6 years ago

Data from received from the network is untrusted, but rust relies on strings being valid UTF-8 for safety. Replace from_utf8_unchecked with from_utf8 to avoid this potential security hole.

luciusmagn commented 6 years ago

You are absolutely correct. I did that as a shortcut (because we are sending data from Rust to Rust) and as a temporary solution. We will soon be sending proper packets instead of plain text