GTK file picker selection with keyboard or double click is broken

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
ron_1
Knows the dark side
Knows the dark side
Posts: 3141
Joined: 2012-06-28, 01:20

Re: GTK file picker selection with keyboard or double click is broken

Post by ron_1 » 2026-06-30, 22:51

Moonchild wrote:
2026-06-30, 18:05
but I'll let the vocal minority of Linux users decide whether they think it should be done or not.
I can wait.

User avatar
JayByrd
Apollo supporter
Apollo supporter
Posts: 38
Joined: 2024-06-02, 19:57
Location: Seattle, Washington

Re: GTK file picker selection with keyboard or double click is broken

Post by JayByrd » 2026-06-30, 23:02

I tend to agree here: definitely not worth breaking double-click/enter-key functionality to address a low-severity, low-probability "exploit." (If it hadn't been brought to our attention, I'm sure most of us would have kept on using it without ever knowing there was a "flaw" in the file-chooser!)

In any event, it is still irking me that the changes in the PR didn't work. I may keep digging to try to find out how to guard against the social-engineering exploit, without breaking the existing functionality. If I do solve the mystery, I'll report back here.

@andy
Unfortunately, the workaround works only for GTK3 builds, but doesn't seem to have any effect when using GTK2. :( Like I said, I'll keep poking around... ;)

User avatar
andyprough
Forum staff
Forum staff
Posts: 1574
Joined: 2020-05-31, 04:33

Re: GTK file picker selection with keyboard or double click is broken

Post by andyprough » 2026-07-01, 00:53

JayByrd wrote:
2026-06-30, 23:02
@andy
Unfortunately, the workaround works only for GTK3 builds, but doesn't seem to have any effect when using GTK2. :( Like I said, I'll keep poking around... ;)
Should still be able to drag and drop a file, right? The preference shouldn't be the only workaround I wouldn't think.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1930
Joined: 2018-10-28, 19:56
Location: Georgia

Re: GTK file picker selection with keyboard or double click is broken

Post by athenian200 » 2026-07-01, 01:06

Would this mean that GTK2 does in fact requires people to call file picker dialogs in an insecure way that can lead to exploits?

If so, it does seem to justify the removal decisions distros are making lately. Also likely worth noting that GTK2-specific exploits may not even have their own CVEs at this point seeing as Firefox no longer uses it... so this could just be the tip of the iceberg.

However, dinosaur noted something interesting in an earlier post:
dinosaur wrote:
2026-06-30, 16:29
Working fine for me with GTK2 builds, but I don't even use it: I have ui.allow_platform_file_picker set to false in about:config (I prefer PM's file picker to GTK2's: leaner, less UI clutter). :D
I think we have a built in XUL-based file picker that is a bit more limited than the native file pickers are, right? Could we possibly use that by default? I think that one should either be more secure by default, or else we can tweak its behavior to make it more secure.

It doesn't seem like users are that bent on using the native file picker dialog, and they can always change the preference if they don't like the new behavior.
"Linux makes everything difficult." -- Lyceus Anubite
"Linux is a cancer that attaches itself in an intellectual property sense to everything it touches. That's the way that the license works." -- Steve Ballmer
"We always overestimate the change that will occur in the next two years and underestimate the change that will occur in ten." -- Bill Gates

User avatar
wmlive
Apollo supporter
Apollo supporter
Posts: 43
Joined: 2023-07-20, 12:03

Re: GTK file picker selection with keyboard or double click is broken

Post by wmlive » 2026-07-01, 01:20

Moonchild wrote:
2026-06-30, 18:05
I've just backed out the change, reverting to what we had before, instead of leaving the default set to something that isn't working as expected, to avoid other side effects.
I'm on the fence about making an out of band release for this (for Linux only) but I'll let the vocal minority of Linux users decide whether they think it should be done or not.
Just did a preliminary gtk2 build on debian/bookworm while applying the cherrypicked patch supplied with #3137 and verified the file chooser works as expected.
No need for an out of band release for such a minor issue if all what is needed is to simply apply that small patch by builders who are redistributing palemoon binaries.

I'd very much dislike if the file chooser's expected functionality would be broken by an overzealous fix for some hypothetical threat scenario one usually never stumbles over in the real world.

Give me a few day's time to create the usual range of gtk2 based packages.
Project leader at https://wmlive.rumbero.org

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2572
Joined: 2018-05-05, 13:29

Re: GTK file picker selection with keyboard or double click is broken

Post by vannilla » 2026-07-01, 11:58

athenian200 wrote:
2026-07-01, 01:06
Would this mean that GTK2 does in fact requires people to call file picker dialogs in an insecure way that can lead to exploits?
The GTK3 default file picker has the same "social engineering" issue, it's not a matter of 2 vs 3. The difference is that UXP, inheriting from Mozilla, overrides some behaviour and this allows to patch this issue without waiting for GTK.
The pref swaps the file picker to GTKFilePickerNative which does not exist in GTK2, that's why it doesn't work.