Ticket UUID: | 10b38a7a7c13235296cb0fbc6205f591d5ed15a4 | |||
Title: | macOS Sonoma requires NSApplicationDelegate.applicationSupportsSecureRestorableState | |||
Type: | Bug | Version: | 8.6.13 | |
Submitter: | aivarannamaa | Created on: | 2023-10-18 07:54:38 | |
Subsystem: | 66. Aqua Window Operations | Assigned To: | kevin_walzer | |
Priority: | 5 Medium | Severity: | Minor | |
Status: | Closed | Last Modified: | 2023-10-18 19:52:04 | |
Resolution: | Fixed | Closed By: | kevin_walzer | |
Closed on: | 2023-10-18 19:52:04 | |||
Description: |
Tkinter people discovered (https://github.com/python/cpython/issues/110950), that macOS Sonoma introduced a new warning:
I'm worried that next macOS version may turn this warning into an error, so it may be worth getting rid of it before the next release. Here's a selection of other projects' approaches to the same issue: https://github.com/search?q=applicationSupportsSecureRestorableState&type=pullrequests | |||
User Comments: |
kevin_walzer added on 2023-10-18 19:52:04:
Generally Tk updates, especially at this low level, flow directly into Tkinter. chrstphrchvz added on 2023-10-18 16:56:45: Thanks for the fix, Kevin. I have not confirmed whether it prevents the warning from Tkinter, but I have confirmed it avoids the warning for Wish. There is a little more info on secure restorable state in the macOS 12 Monterey AppKit release notes. kevin_walzer added on 2023-10-18 13:46:00: I have added this call to TkAqua on trunk and core-8-0-branch. Thanks for the report. chrstphrchvz added on 2023-10-18 13:45:20: I have confirmed that the warning appears for a framework build of Tk Aqua using the macOS 13 SDK: $ wish8.6 % 2023-10-18 08:17:10.525 Wish[25873:92143] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES. chrstphrchvz added on 2023-10-18 13:18:16: The applicationSupportsSecureRestorableState method is in response to an AppKit security vulnerability: https://sector7.computest.nl/post/2022-08-process-injection-breaking-all-macos-security-layers-with-a-single-vulnerability/, so the Sonoma warning is presumably meant to promote its use. I do not know whether this vulnerability is possible with Tcl/Tk, but still I do not see an issue with Tk Aqua implementing the suggested method. chrstphrchvz added on 2023-10-18 12:38:36: I am a Tk Aqua contributor, but do not consider my comment to be authoritative. I have seen this warning in Tkinter for certain builds of Python (e.g. system Python, Python.org installer), though I am still trying to figure out how to see it directly from Tcl/Tk; maybe it only affects Tk framework builds which I do not typically use. The macOS 14 Sonoma AppKit release notes mention that secure coding for restorable state is automatically enabled when using the macOS 14 SDK, so my understanding is that this warning would only appear for builds using older SDKs. I am not familiar with restorable state in AppKit, but it sounds like something that likely is not useful for Tcl/Tk, whether because most Tk programs have no concept of restorable state and just recreate their UI from scratch on launch, or because Tk Aqua (maybe intentionally) does not use the AppKit features supporting restorable state. But maybe Tk Aqua can still implement the method suggesting by the warning, even though the only thing that would be gained is that the warning no longer appears. |
