From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#72245: [PATCH] Fix integer overflow when reading XPM Date: Mon, 22 Jul 2024 20:04:23 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36977"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72245@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 23 05:06:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sW5r8-0009TB-Ra for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jul 2024 05:06:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sW5ql-0002Xy-Sd; Mon, 22 Jul 2024 23:06:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sW5qh-0002W3-L8 for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2024 23:06:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sW5qg-0005Cr-DI for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2024 23:05:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sW5qj-0007ep-Ry for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2024 23:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jul 2024 03:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72245 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72245-submit@debbugs.gnu.org id=B72245.172170393729401 (code B ref 72245); Tue, 23 Jul 2024 03:06:01 +0000 Original-Received: (at 72245) by debbugs.gnu.org; 23 Jul 2024 03:05:37 +0000 Original-Received: from localhost ([127.0.0.1]:58861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sW5qL-0007e8-7t for submit@debbugs.gnu.org; Mon, 22 Jul 2024 23:05:37 -0400 Original-Received: from mail-ed1-f52.google.com ([209.85.208.52]:51627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sW5qI-0007ds-6V for 72245@debbugs.gnu.org; Mon, 22 Jul 2024 23:05:36 -0400 Original-Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5a167b9df7eso4915244a12.3 for <72245@debbugs.gnu.org>; Mon, 22 Jul 2024 20:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721703864; x=1722308664; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=uVf9z17RaQevAqWlGn6ncehVVjLVa+LdQwaIcZFJNSY=; b=VHOwp9ZmmvRXI9ciCT2R1UMseRfiMmuMqCNlYqe+Cw79j4/0dNaxaVBYJ6lYXPkPNE KOno/sTddFuI2MqWkpjAslEzruELHT4jO54vVrdT6WKJ2zkmOFnNtlAApXDn2Ag3W2ui aJdRvS/vbHkgizGC3DiQw+PdniZjPzqoB4is++yAiwESEybMmkE1CoV0OcFxAq3Se+Z1 MZr4i7UaYSLv6emtKyskwZZtIm1CKNHKi+k9jlEJWe1d6kjihcdRJP78TGuHD4fDgz/l 1VaMYrhA0PxFRpoBeL34e56uhP5PTWc+TM9BzwtvjkS+FlYA5K64Iok3UL27BH3dhky9 kILQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721703864; x=1722308664; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uVf9z17RaQevAqWlGn6ncehVVjLVa+LdQwaIcZFJNSY=; b=f6F5KvE6wGugckC5bhgHItFfgqMy9XK+W4tLNGmjnsbfYegZjn4blsm23/dqTDdndP +kp/DsAAUDUnZoU2ZFmIs1aGZXUfUV360ukmMpTPbO7h5gJGSo2JWpnCpRo0pP/MERoc ID90eKqVQ9MpkLMUTMF3njBIgxPg5mH/Rc+PsA+Ih6fIQjwYRDBolwMHyR9DdSV9Z4ap KWbkVb/z4ZrnMwfo96blFW14LUEbB9eoV2cN7/AdcZcoiSNs58+o2syRnPeSogreOHPf 5O0VqeZzt4h+lxCH6VIf5qLiAV7Rw5RPSnnV1QmUBuKCzvSOXnW4BmuVfWr4F76MNVDX N3RA== X-Gm-Message-State: AOJu0YxiAXeIO95txFq75AqtMiO0pfyISdijTJ+evK8aOiLsomrmCIQD o9nvWj4aUnxnl2vMZ4UfAD7dC7pQXmdFUck8qcEDye+443ls8k6/OfsVOEPE/eVuqS1cfvVX3cb 0oCtlD5kcvoc0tIlvFXQTd9NHSvQ= X-Google-Smtp-Source: AGHT+IFGeH5d4DSDacsqLNFuK5iAFTNKVfdzcQEz0IIv6Aolr9Yebp8tvVsnMS7AYUac50I5iy2aczm3rpyWG45P5h8= X-Received: by 2002:a05:6402:2809:b0:58c:804a:6ee2 with SMTP id 4fb4d7f45d1cf-5a4786822d1mr7006216a12.20.1721703864201; Mon, 22 Jul 2024 20:04:24 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 22 Jul 2024 20:04:23 -0700 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289136 Archived-At: Po Lu writes: > Stefan Kangas writes: > >> Severity: minor >> >> Since XPM files are untrusted input, I think we'd better handle >> integer >> overflow when parsing it, in case the file is malformed. >> >> Proposed patch attached. > > What are the security implications of accepting whatever scanf produces > in the event of an overflow? There is a good summary here: https://cwe.mitre.org/data/definitions/190.html