Skip to main content

协议处理程序漏洞修复

· 3 min read

已经发现了一个影响使用自定义协议处理程序的 Electron 应用的远程代码执行漏洞。该漏洞已被分配 CVE 标识符 CVE-2018-1000006

🌐 A remote code execution vulnerability has been discovered affecting Electron apps that use custom protocol handlers. This vulnerability has been assigned the CVE identifier CVE-2018-1000006.


受影响的平台

🌐 Affected Platforms

在 Windows 上运行的 Electron 应用,如果将自己注册为某个协议(如 myapp://)的默认处理程序,就存在漏洞。

🌐 Electron apps designed to run on Windows that register themselves as the default handler for a protocol, like myapp://, are vulnerable.

无论协议如何注册,例如使用本地代码、Windows 注册表或 Electron 的 app.setAsDefaultProtocolClient API,这类应用都可能受到影响。

🌐 Such apps can be affected regardless of how the protocol is registered, e.g. using native code, the Windows registry, or Electron's app.setAsDefaultProtocolClient API.

macOS 和 Linux 不受此问题影响

🌐 macOS and Linux are not vulnerable to this issue.

缓解措施

🌐 Mitigation

我们已经发布了包含此漏洞修复的新版本 Electron: 1.8.2-beta.51.7.12、 和 1.6.17。 我们强烈建议所有 Electron 开发者立即将他们的应用更新到最新的稳定版本。

🌐 We've published new versions of Electron which include fixes for this vulnerability: 1.8.2-beta.5, 1.7.12, and 1.6.17. We urge all Electron developers to update their apps to the latest stable version immediately.

如果由于某种原因你无法升级 Electron 版本, 你可以在调用 app.setAsDefaultProtocolClient 时将 -- 作为最后一个参数附加,这可以防止 Chromium 解析更多选项。 双破折号 -- 表示命令选项的结束,之后只接受位置参数。

🌐 If for some reason you are unable to upgrade your Electron version, you can append -- as the last argument when calling app.setAsDefaultProtocolClient, which prevents Chromium from parsing further options. The double dash -- signifies the end of command options, after which only positional parameters are accepted.

app.setAsDefaultProtocolClient(protocol, process.execPath, [
'--your-switches-here',
'--',
]);

有关更多详情,请参阅 app.setAsDefaultProtocolClient API。

🌐 See the app.setAsDefaultProtocolClient API for more details.

要了解有关保持你的 Electron 应用安全的最佳做法,请参阅我们的 [安全教程]。

🌐 To learn more about best practices for keeping your Electron apps secure, see our security tutorial.

如果你希望报告 Electron 中的漏洞,请提交 [GitHub 安全咨询]。

🌐 Please file a GitHub Security Advisory if you wish to report a vulnerability in Electron.