From nobody Wed Nov 30 00:46:00 2022 X-Original-To: freebsd-security@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NML9P12jJz4j2R7 for ; Wed, 30 Nov 2022 00:46:01 +0000 (UTC) (envelope-from security-advisories@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 4NML9P0YsLz47QL; Wed, 30 Nov 2022 00:46:01 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669769161; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=w6KDHn3E2A8Xa2AQiCUv1Hl/I3U/ccaaMRsMejP6CLo=; b=DyW4EvR0d+96yuEpafWCU/Zi9d9dtVF9AcL70tnci9tDyGhPAqgsvwPD/uyfXoKS8+1d00 xdAzJUGNGblJU5P+M+E4I/y270qP7fb/A7WzkgHXKd5kt7xCefv1qDnZDycGMed18nO7KD iPVuf2noiIbbwxbd1pVQQHb/SD9IJ0YovysJdNsvR45QWM3IHT7slVWR/cHw2I7ow0AUuw kyjt3Xs3UBZAwEVfvey1EYcpnooX7TDBpWEb5oZxlBrakp9sLYZ0aWPuzKUY2Awg+NSaLa rG44LliEgAxUA2nkTuyJNXVxgQrARkE1kS80jT2sKUxo04q5KQgUxTPFiw66Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669769161; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=w6KDHn3E2A8Xa2AQiCUv1Hl/I3U/ccaaMRsMejP6CLo=; b=QNwYL+NLAgzsW6XNfRJkGOfuhsiX9K3DDP82pKZL9ZqFTKa0GHbIwug/phIdFmd9lFyAAi FMvHGL7jlOJRtdLW8chiTdUmK/oGx3f3oUSyYHs7bVeq+FF6R3qYsip9toN/NQTGA5R2RH v13GPhxuGcTHbLSdyHdPbML+6MrmGDpQDegyxAOmj1aPNVZ2sUkNdW+9lpghUs2h98jio6 3j4+EO3AJ+RkOPcFPdc6zZ1V8rdlyAIm5+fLSVEABqK/A5kNWcshfS1159I6J0XAYB6hfe nvdsNyFohTA4m5jhfVNk/AdyFKxU6Urh9yMW0yGIEuOqy1Lpq4FGEFHDmO1u7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669769161; a=rsa-sha256; cv=none; b=Bteo0dukTQd8D13BfsIs1fGR6B4J/KHiGYglXdnFeINWyDSTJ1KYlUEAT7cAOJbAe4WGJS wzKOoWmJ9atb6WQkypc6Y2+UI7D1uWK7RvYS5hl6ftREZCrfznBwWWnKMbtBDEjXFQzGYG lPfEWspXE2umAwKto78aIkbSam7jC/hYY7eNVYq9zwkS5vSACpe2AC6J7VAgxdPTiiwa4t 7eGGic1a7YHKBfhMueRfNay+WzzhDikPeHctoq/nX5Q4kvl6ausSRzGV6sUvctja4nunS7 q5eGiYKs3Ivgx1f5RjpoaiIRgi9ZQ8Y8QDDC2QtEuO7qRCkuSkQ+dzSLc2tnkg== Received: by freefall.freebsd.org (Postfix, from userid 945) id EFDFF1C46E; Wed, 30 Nov 2022 00:46:00 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-22:15.ping Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20221130004600.EFDFF1C46E@freefall.freebsd.org> Date: Wed, 30 Nov 2022 00:46:00 +0000 (UTC) X-ThisMailContainsUnwantedMimeParts: N List-Id: Security issues List-Archive: https://lists.freebsd.org/archives/freebsd-security List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-security@freebsd.org X-BeenThere: freebsd-security@freebsd.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-22:15.ping Security Advisory The FreeBSD Project Topic: Stack overflow in ping(8) Category: core Module: ping Announced: 2022-11-29 Credits: Tom Jones Affects: All supported versions of FreeBSD. Corrected: 2022-11-29 22:56:33 UTC (stable/13, 13.1-STABLE) 2022-11-29 23:00:43 UTC (releng/13.1, 13.1-RELEASE-p5) 2022-11-29 22:57:16 UTC (stable/12, 12.4-STABLE) 2022-11-29 23:19:09 UTC (releng/12.4, 12.4-RC2-p2) 2022-11-29 23:16:17 UTC (releng/12.3, 12.3-RELEASE-p10) CVE Name: CVE-2022-23093 For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background ping(8) is a program that can be used to test reachability of a remote host using ICMP messages. To send and receive ICMP messages, ping makes use of raw sockets and therefore requires elevated privileges. To make ping's functionality available to unprivileged users, it is installed with the setuid bit set. When ping runs, it creates the raw socket needed to do its work, and then revokes its elevated privileges. II. Problem Description ping reads raw IP packets from the network to process responses in the pr_pack() function. As part of processing a response ping has to reconstruct the IP header, the ICMP header and if present a "quoted packet," which represents the packet that generated an ICMP error. The quoted packet again has an IP header and an ICMP header. The pr_pack() copies received IP and ICMP headers into stack buffers for further processing. In so doing, it fails to take into account the possible presence of IP option headers following the IP header in either the response or the quoted packet. When IP options are present, pr_pack() overflows the destination buffer by up to 40 bytes. III. Impact The memory safety bugs described above can be triggered by a remote host, causing the ping program to crash. It may be possible for a malicious host to trigger remote code execution in ping. The ping process runs in a capability mode sandbox on all affected versions of FreeBSD and is thus very constrainted in how it can interact with the rest of the system at the point where the bug can occur. IV. Workaround No workaround is available. 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. # fetch https://security.FreeBSD.org/patches/SA-22:15/ping.patch # fetch https://security.FreeBSD.org/patches/SA-22:15/ping.patch.asc # gpg --verify ping.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 . 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/ 186f495d4be1 stable/13-n253187 releng/13.1/ 66c7b53d9516 releng/13.1-n250172 stable/12/ r372774 releng/12.4/ r372778 releng/12.3/ r372775 - ------------------------------------------------------------------------- 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/A6HiuWv54gCjWNV05eS9J6n5cIFAmOGlvgACgkQ05eS9J6n 5cIQGw//ZiF50YbtOc7oYgVcJTGlBEAbKWV6OteTDpXWb/OlwkznGxwzrG0DPvWN wHyItOPSAmdxqC4xZUsZh9HNxlim80r5TR1y4BE22Lsg2vL5Ir0h3tcqOKKpHYLS KzNgishF1+J56JeU3TpTjOe5QbXK3EZiw092lH8uSXTp3PqcHxBfFuW9Cjc1Rq/u ewjHWI7zNCMOpGh3w/v14ZxGl3aFusL1jmrcyi5kZub2Pr0N3bUKgS3/3wXfWF6o hcFhl1ChmAwpT/1313LNE7SHPl4HCC5XK4r3w+wniLjOJUhnioOBjay29QLt5O53 0rYaINNvo7ooBSpcPO9ixta+7dqah+uuW3vnFewuahqNCaAGLhMDSPqyZW7KfYgU F7TIDoBRHPHASFb3FOiAAcCNMCvmGl7vFyVoWe0xJ1ion2jqO83R8XOGgnHsPL/l cTYTPdECPMIDMvmfIH9UAbNCzKEYdNjWsXUjFJKkxCBtwUcBRsn1TEu24zU2j9mS hRlY1DAYVy8raYUnQp/f6Llroim5DKyUYpJpeB3j//Fk6KACRnZKsqsSIj9U3OYf KD6zfJ35RrolPHePMPmy6vGPDYFocDo+YQSm1eauwfSeDGnsjBmIdzxahkgEav4Z 5agsPd2naEntMiJkGGgeuYCifEvkCttJbuTn2s+7VkuTap0uTuA= =rown -----END PGP SIGNATURE-----