Skip to content

Commit

Permalink
mac/apphub: remove mpv:// protocol handling
Browse files Browse the repository at this point in the history
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.

Fixes: 494d408
  • Loading branch information
kasper93 committed Feb 23, 2025
1 parent 1615ae4 commit bb6fb3e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions osdep/mac/app_hub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class AppHub: NSObject {
var cocoaCb: CocoaCB?
#endif

let MPV_PROTOCOL: String = "mpv://"
var isApplication: Bool { return NSApp is Application }
var isBundle: Bool { return ProcessInfo.processInfo.environment["MPVBUNDLE"] == "true" }
var openEvents: Int = 0
Expand Down Expand Up @@ -109,7 +108,6 @@ class AppHub: NSObject {
let files = urls.map {
if $0.isFileURL { return $0.path }
var path = $0.absoluteString
if path.hasPrefix(MPV_PROTOCOL) { path.removeFirst(MPV_PROTOCOL.count) }
return path.removingPercentEncoding ?? path
}.sorted { (strL: String, strR: String) -> Bool in
return strL.localizedStandardCompare(strR) == .orderedAscending
Expand Down

0 comments on commit bb6fb3e

Please sign in to comment.