History

mac/apphub: remove mpv:// protocol handling

It has been moved to the mpv core with additional security considerations, including filtering unsafe protocols from being opened via the URL handler. While we are not aware of any active exploitation, naive protocol handling could allow the use of niche protocols in FFmpeg, which, in turn, might load native code. How such native code would be dropped on the local machine is another question. This remains theoretical, but it's better to be safe than sorry.

Kacper Michajłow committed 1 year ago

Commit 2799d8b1 parent 93ea3df1 file · +0 −2Browse files

Unified · Split

osdep/mac/app_hub.swift+0−2
@@ -36,7 +36,6 @@ class AppHub: NSObject { · 35 unmodified lines
3636 var cocoaCb: CocoaCB?
3737 #endif
3838
39− let MPV_PROTOCOL: String = "mpv://"
4039 var isApplication: Bool { return NSApp is Application }
4140 var isBundle: Bool { return ProcessInfo.processInfo.environment["MPVBUNDLE"] == "true" }
4241 var openEvents: Int = 0
@@ -109,7 +108,6 @@ class AppHub: NSObject { · 66 unmodified lines
109108 let files = urls.map {
110109 if $0.isFileURL { return $0.path }
111110 var path = $0.absoluteString
112− if path.hasPrefix(MPV_PROTOCOL) { path.removeFirst(MPV_PROTOCOL.count) }
113111 return path.removingPercentEncoding ?? path
114112 }.sorted { (strL: String, strR: String) -> Bool in
115113 return strL.localizedStandardCompare(strR) == .orderedAscending

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t