public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stephane+sourceware at chazelas dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug glob/31075] fnmatch("??") matches on one two byte valid character (as well as two any-length characters)
Date: Fri, 24 Nov 2023 19:56:04 +0000	[thread overview]
Message-ID: <bug-31075-131-SfxBcT20b9@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31075-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31075

Stephane Chazelas <stephane+sourceware at chazelas dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|fnmatch("??") matches on    |fnmatch("??") matches on
                   |2-byte single characters    |one two byte valid
                   |(as well as 2 any-length    |character (as well as two
                   |characters)                 |any-length characters)
              Flags|                            |security?

--- Comment #2 from Stephane Chazelas <stephane+sourceware at chazelas dot org> ---
Can likely be considered a security issue as that means patterns match things
that where not intended be matched (I'll let you guys decide on that), but on
the other hand that bug works around long-standing issues whereby for instance

find . ! -name '*evil*' -exec ... {} +

was failing to exclude file names containing "evil" when what's on either side
is not valid text in the users locale (a common issue these days where UTF-8 is
the norm).

Though of course falling back to treating both pattern and subject as char[]
arrays when the subject cannot be decoded as text like bash does (and what
might have been the intent of a79328c745219dcb395070cdcd3be065a8347f24) is
incorrect (see
https://lists.gnu.org/archive/html/bug-bash/2021-02/msg00054.html for more
details).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2023-11-24 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-18 10:03 [Bug glob/31075] New: fnmatch("??") matches on 2-byte single characters (as well as 2 " stephane+sourceware at chazelas dot org
2023-11-18 11:53 ` [Bug glob/31075] " stephane+sourceware at chazelas dot org
2023-11-24 19:56 ` stephane+sourceware at chazelas dot org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31075-131-SfxBcT20b9@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).