From owner-freebsd-security-notifications@freebsd.org Thu May 27 00:55:13 2021 Return-Path: Delivered-To: freebsd-security-notifications@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB2CA64A880 for ; Thu, 27 May 2021 00:55:13 +0000 (UTC) (envelope-from security-advisories@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fr8Vn6MhQz54t7; Thu, 27 May 2021 00:55:13 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1622076913; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=ZfShh7GiY6iDjKHD5NInZh+Xeb/RH2qsIEjyDBn742Y=; b=mBGEas0dmpZJDHyYNO6aQ0VYmDTObWQaE6Gw18f35zxyx156q43N99g67XQC9gKTmMdGfN W1HdTKewjQAdrz+vR1gp2iYVNFP5TxP8jfDTkXqHE6fPScCoUMKe/utxO6q6gDhe6PUhI+ zEFOH2oYb/7lzHyt2FaMoVzTcrolKUA6KAzzbt03LNFCGy1lN5agwybqIFPsIxFH6UJtHp gGl8hGaberydgyWkR/iGDvKiRMsumfRp6gZo9wEviOpfOsKwV/5F+M6cz8TYiUXjJW0jmt MeTZvkPcPqsyt9ThWaNfrOjA2SiGTakSGYpmOcySieAkfe6dzIBvHrEGPJmGdQ== Received: by freefall.freebsd.org (Postfix, from userid 945) id CB2EB17AB2; Thu, 27 May 2021 00:55:13 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-21:12.libradius Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20210527005513.CB2EB17AB2@freefall.freebsd.org> Date: Thu, 27 May 2021 00:55:13 +0000 (UTC) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1622076913; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=ZfShh7GiY6iDjKHD5NInZh+Xeb/RH2qsIEjyDBn742Y=; b=ehzS4rAv/T3VqucvEQs8E3euqe1os/AEnudkG5A70NLRXQa03NDhzCL4jAaUYQlUsAOIqG oS9Y/zZc0BNA6iJj8yHhBLbJQ7RY48hFqKalaAv6ocAUVb9clSXBStfrq3lVbM7Dfdrc2M Ooppt0n0e7El0azW6+wNqSnsLVxVb28jKn1kkRV2kO20KOXkLAlcNFlhohszgTzeAWBvBH irxhtFRP1d5EToyNowf6f6HHOOw0AA457Lu7BHjZ0TocN3DkQPsV2aFLJVXV5vP4FUDWU/ raxNJ6fIZkrUy6OrQhgo9dSfndbsHovkJ3bVclLG7G4OoPfquR3qD+Tn3oOtPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1622076913; a=rsa-sha256; cv=none; b=GQJZcHduDJTXxLicSxOSobzzJPaUMW5EoTk92dei4M7XxZ4ZrqAAsL9o8DZD033yYptuPv 9dNUcoy8+p/tgS6fLRZQ+KpnviAAzOfOKtfo4decGnVmZ7mn5uj8+q7xo66FVQZCBR+fAh vippO4ikpjPZqBVZEhd6IHxxj24yap2Q+faHyovFOHTHGWHznMi74XZptQxvpCBp+B4cpb TKtuCuuqegf8+ELhaSk/OLUPPaLrn6v0+fQVt6iw8v0+ikai6FrNYKqSFowo3xtKrLedUm pV0Ww5wKqseUGbHBoGcV3spSWaU9Y8e4kbdFgkx6riWCMe+mAO1eLnTFozjNvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: freebsd-security-notifications@freebsd.org X-Mailman-Version: 2.1.34 List-Id: "Moderated Security Notifications \[moderated, low volume\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 00:55:14 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-21:12.libradius Security Advisory The FreeBSD Project Topic: Missing message validation in libradius(3) Category: core Module: libradius Announced: 2021-05-26 Credits: leommxj and Swings from Chaitin Security Research Lab Affects: All supported versions of FreeBSD. Corrected: 2021-05-26 19:45:31 UTC (stable/13, 13.0-STABLE) 2021-05-26 20:36:29 UTC (releng/13.0, 13.0-RELEASE-p1) 2021-05-26 20:39:35 UTC (stable/12, 12.2-STABLE) 2021-05-26 20:40:23 UTC (releng/12.2, 12.2-RELEASE-p7) 2021-05-26 20:41:31 UTC (stable/11, 11.4-STABLE) 2021-05-26 20:41:58 UTC (releng/11.4, 11.4-RELEASE-p10) CVE Name: CVE-2021-29629 For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background libradius(3) is a client and server library implementing the Remote Authentication Dial In User Service (RADIUS) protocol. It is used by pam_radius(8) and mpd5 (available in the ports tree as net/mpd5). II. Problem Description libradius did not perform sufficient validation of received messages. rad_get_attr(3) did not verify that the attribute length is valid before subtracting the length of the Type and Length fields. As a result, it could return success while also providing a bogus length of SIZE_T_MAX - 2 for the Value field. When processing attributes to find an optional authenticator, is_valid_response() failed to verify that each attribute length is non-zero and could thus enter an infinite loop. III. Impact A server may use libradius(3) to process messages from RADIUS clients. In this case, a malicious client could trigger a denial-of-service in the server. A client using libradius(3) to process messages from a server is susceptible to the same problem. The impact of the rad_get_attr(3) bug depends on how the returned length is validated and used by the consumer. It is possible that libradius(3) applications will crash or enter an infinite loop when calling rad_get_attr(3) on untrusted RADIUS messages. IV. Workaround No workaround is available. Systems not making use of libradius(3) are unaffected. V. Solution Upgrade your vulnerable system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date. Perform one of the following: 1) To update your vulnerable system via a binary patch: Systems running a RELEASE version of FreeBSD on the amd64, i386, or (on FreeBSD 13 and later) arm64 platforms can be updated via the freebsd-update(8) utility: # freebsd-update fetch # freebsd-update install 2) To update your vulnerable system via a source code patch: The following patches have been verified to apply to the applicable FreeBSD release branches. a) Download the relevant patch from the location below, and verify the detached PGP signature using your PGP utility. [FreeBSD 13.0, 12.2] # fetch https://security.FreeBSD.org/patches/SA-21:12/libradius.patch # fetch https://security.FreeBSD.org/patches/SA-21:12/libradius.patch.asc # gpg --verify libradius.patch.asc [FreeBSD 11.4] # fetch https://security.FreeBSD.org/patches/SA-21:12/libradius.11.patch # fetch https://security.FreeBSD.org/patches/SA-21:12/libradius.11.patch.asc # gpg --verify libradius.11.patch.asc b) Apply the patch. Execute the following commands as root: # cd /usr/src # patch < /path/to/patch c) Recompile the operating system using buildworld and installworld as described in . Restart all daemons that use the library, or reboot the system. VI. Correction details This issue is corrected by the corresponding Git commit hash or Subversion revision number in the following stable and release branches: Branch/path Hash Revision - ------------------------------------------------------------------------- stable/13/ bec0d2c9c841 stable/13-n245765 releng/13.0/ 7d900abe6269 releng/13.0-n244743 stable/12/ r369859 releng/12.2/ r369864 stable/11/ r369866 releng/11.4/ r369867 - ------------------------------------------------------------------------- For FreeBSD 13 and later: Run the following command to see which files were modified by a particular commit: # git show --stat Or visit the following URL, replacing NNNNNN with the hash: To determine the commit count in a working tree (for comparison against nNNNNNN in the table above), run: # git rev-list --count --first-parent HEAD For FreeBSD 12 and earlier: Run the following command to see which files were modified by a particular revision, replacing NNNNNN with the revision number: # svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base Or visit the following URL, replacing NNNNNN with the revision number: VII. References The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/A6HiuWv54gCjWNV05eS9J6n5cIFAmCu6vMACgkQ05eS9J6n 5cLBUQ//aEsqwU/okABtOEAYbr87TSl0eHpmnNjfLS/OHgkQ7FPIBCpF2ThifBk3 t84F9q5ILOizrc916hT4RzFkTdHwVOGJCk7uEWwYCkHnDOIIzsbKD8Jzv+nKJf2P hyrm5aVmRyEgwImZFv3158dmaK+AvrrFoWOwZDW+A1zBDrf/EgCKCAFTn9I72wZI 1HoPkO8I4lJYTDKkr1AQ2Xh0fHYwcP5myvGZFwIJftmG6BbETgAzfPPiwiMC/dN4 ZUkyyZI9O+kfzRH+iIchEt+kls7m0eXIt5EQmVAyCj76Npa0zCPXa5pPLJ9no6N7 YT2nuuOGQUeriaMo1P9PeMhGECOcdW96DWuXGKsTjGei70634eADxmv8tjR0Vndm VPbi3f9O4d8Yqsr+ioNm1dwT8kgbChbTBob/r6NyIWqJVsinIVSI+u9U7aCAlxpK 6grc9FUZDHpGdP2DqdE5iZ4WSkjh7yZR9676sHmIvdnNkUT5LonxP8iDmGbexlLZ mGAiNNaI19hEeaf+1AyF0l8/VZdvgZsjoSYUtATqYH6aO4xF6MMzirKYtfbphrdj +BwVyZB4WRU0S71v2zkz7wAlErQnwRI+CYvZFxe7jyMkk5C70btxZllAs9dgYsHE DL7SugtvoKb/eBtIfSCSf6fe+MW1poIG0G7T26K5crHNiUxHYvY= =yqoJ -----END PGP SIGNATURE-----