A FreeBSD 13-ban majdnem egy silány WireGuard megvalósítás került be, amely megsértette a licencet és sebezhetőségeket tartalmazott.

A FreeBSD 13 release was controversially stripped of the code implementing the VPN protocol WireGuard, developed on behalf of Netgate without consultation with the original WireGuard developers, and which had already been included in the stable releases of the pfSense distribution. After reviewing the code by Jason A. Donenfeld, the author of the original WireGuard, it became clear that the proposed implementation for FreeBSD represented a prime example of poor-quality code, rife with buffer overflows and violating the GPL license.

The implementation contained catastrophic flaws in the cryptographic code, missing parts of the WireGuard protocol, and errors that led to kernel crashes and circumvention of protection methods, using fixed-size buffers for input data. The quality of the code is further evidenced by the presence of stubs instead of checks, which always return a "true" value, as well as forgotten debug printf statements outputting parameters used for encryption, and the use of the sleep function to prevent race conditions.

Some parts of the code, such as the crypto_xor function, were transferred from WireGuard's implementation for Linux in violation of the GPL license. As a result, Jason Donenfeld, along with Kyle Evans and Matt Dunwoodie (the author of the WireGuard port for OpenBSD), took on the task of reworking the problematic implementation and completely replaced all of the Netgate-hired developer's code within a week. The revised version was released as a separate set of patches, hosted in the WireGuard project repository, and has not yet been included in FreeBSD.

Érdekes, hogy kezdetben semmi nem jelezte a problémát, a Netgate cég, amely a WireGuard használatra szeretett volna lehetőséget kapni a pfSense disztribúcióban, felkérte Matthew Macy-t, aki jól ismeri a FreeBSD kernelét és hálózati stackjét, részt vett a hibák javításában, és tapasztalattal rendelkezik e hálózati operációs rendszerhez készült illesztőprogramok fejlesztésében. Macy-nek szabad időbeosztást adtak határidők és köztes ellenőrzések nélkül. A FreeBSD-n dolgozó fejlesztők Macy-t tehetséges és profi programozónak jellemezték, aki nem hibázik többet, mint mások, és megfelelően reagál a kritikára. Az WireGuard FreeBSD-re való megvalósításának siralmas kódminősége meglepetést okozott számukra.

Kilenc hónapos munka után tavaly decemberben Macy, a harmadik felek általi felülvizsgálat és tesztelés befejezése nélkül, hozzáadta megvalósítását a HEAD ághoz, amely a FreeBSD 13 kiadásának kialakítására szolgált. A fejlesztés az eredeti WireGuard fejlesztőivel és az OpenBSD és NetBSD portokkal való kapcsolat nélkül zajlott. Februárban a Netgate integrálta a WireGuard-ot a pfSense 2.5.0 stabil kiadásába, és elkezdte szállítani az azon alapuló tűzfalakba. A problémák felfedezése után a WireGuard kódját eltávolították a pfSense-ből.

A hozzáadott kódban kritikus sebezhetőségek tűntek fel, amelyeket 0-day exploitokban használtak, de a Netgate az elején nem ismerte el a sebezhetőségek létezését, és megpróbálta megvádolni az eredeti WireGuard fejlesztőjét a támadásokkal és az elfogultsággal, ami negatívan tükröződött a hírnevén. A port fejlesztője kezdetben elutasította a kódminőséggel kapcsolatos panaszokat, és túlzónak tartotta őket, de a hibák demonstrálása után észrevette, hogy valóban fontos probléma a megfelelő kódminőség-ellenőrzés hiánya a FreeBSD esetében, hiszen a problémák hónapokig észrevétlenek maradtak (a Netgate képviselői azt állították, hogy a nyilvános felülvizsgálat már 2020 augusztusában elindult, de a FreeBSD egyes fejlesztői megjegyezték, hogy a Phabricator felülvizsgálata Macy által teljesítés nélkül és a megjegyzések figyelmen kívül hagyásával lezárult). A FreeBSD Core Team reagált az esetre azzal, hogy ígéretet tettek a kódellenőrzési folyamatok modernizálására.

Matthew Maisy, a developer of the problematic port for FreeBSD, commented on the situation by stating that he made a big mistake taking on the project when he was not ready to implement it. He explains the resulting outcome as a consequence of emotional burnout and issues arising from post-COVID syndrome. At the same time, Maisy did not find the determination to refuse the commitments he had already taken on and tried to see the project through to completion.

Maisy's situation may also have been impacted by a recent prison sentence he received for illegal actions in an attempt to evict tenants from the house he purchased, who refused to leave voluntarily. Together with his wife, they weakened the beams of the ceiling and broke holes in the floors to render the house uninhabitable, and they also attempted to intimidate the tenants, broke into occupied apartments, and removed items (this action was classified as burglary). To avoid responsibility for his actions, Maisy and his wife fled to Italy, but he was extradited to the USA and served more than four years in prison.

Forrás: opennet.ru

Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster