Skip to content

fix: resolve authorization popup issue for apps not adapted to secure boot - #1216

Merged
fly602 merged 1 commit into
linuxdeepin:masterfrom
fly602:master
Aug 19, 2026
Merged

fix: resolve authorization popup issue for apps not adapted to secure boot#1216
fly602 merged 1 commit into
linuxdeepin:masterfrom
fly602:master

Conversation

@fly602

@fly602 fly602 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

fix: resolve authorization popup issue for apps not adapted to secure boot

The relevant interfaces have been integrated with secure boot checks. For apps
not adapted to secure boot, the call falls back to polkit authentication, which
prompts an authorization dialog. However, the taskbar and shortcut daemon were
not adapted to secure boot due to project architecture limitations, causing
authorization popups on normal operations like toggling airplane mode and power
mode. This degrades UX for local users.

Note: The current polkit policy is a fallback. Before secure boot was added,
this was the existing policy. Since the taskbar plugin and shortcut daemon call
these interfaces and are not adapted to secure boot, the interface behavior is
temporarily reverted to the old policy to avoid affecting user experience.

Future plan: The security design will be re-evaluated to develop a
security interface implementation plan that fits the V25 architecture.

Log: Authorization popup no longer appears for local users toggling airplane
and power modes via taskbar or shortcuts

Influence:

  1. Verify local active users can toggle airplane mode via shortcut without
    auth dialog
  2. Verify local active users can toggle power mode via taskbar plugin without
    auth dialog
  3. Verify inactive users (e.g., SSH/VNC) are still blocked
  4. Ensure no other polkit policies are affected

涉及接口已加入安全启动校验。对于未适配安全启动的应用,则 fallback 到
polkit 鉴权,polkit 会弹出提权弹窗。但任务栏和快捷键因项目架构限制未适配
安全启动,导致触发设置飞行模式和电源模式等常规操作时弹出授权弹窗。
如果是本地用户,影响用户体验。

目前的 polkit 策略是一个回退,在加 security-loader 之前就是这样的策略。
当前由于任务栏插件、快捷键中有相关接口的调用,且未适配安全启动,为了不
影响用户体验,先将接口的行为暂时回退到旧的策略。

后续计划:后续会重新评估安全方案的整体设计,制定更契合 V25 架构的安全
接口的实施方案。

Log: 本地用户通过任务栏/快捷键切换飞行模式和电源模式不再弹出授权弹窗

Influence:

  1. 测试本地激活用户使用快捷键切换飞行模式,不应弹出授权弹窗
  2. 测试本地激活用户通过任务栏插件切换电源模式,不应弹出授权弹窗
  3. 验证非激活用户(如 SSH/VNC 会话)仍无法执行这些操作
  4. 确认不影响其他 polkit 策略

PMS: TASK-393313

Summary by Sourcery

Bug Fixes:

  • Allow active local users to toggle airplane and power modes without polkit authorization prompts while retaining restrictions for inactive users.

Summary by Sourcery

Bug Fixes:

  • Allow active local users to toggle airplane and power modes without authorization prompts while retaining restrictions for inactive users.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @fly602, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates polkit policies for airplane mode and power mode so that active local users can toggle them without admin authorization, while keeping restrictions for inactive/remote sessions.

File-Level Changes

Change Details Files
Relax polkit authentication requirements for airplane mode toggling for active users.
  • Change the airplane mode polkit policy from requiring persistent admin auth to unconditional allow for active users.
  • Ensure inactive/remote sessions remain restricted from toggling airplane mode.
  • Leave other polkit actions and policies untouched.
misc/polkit-action/org.deepin.dde.airplane.policy
Relax polkit authentication requirements for power mode toggling for active users.
  • Change the power mode polkit policy from requiring persistent admin auth to unconditional allow for active users.
  • Ensure inactive/remote sessions remain restricted from toggling power mode.
  • Leave other polkit actions and policies untouched.
misc/polkit-action/org.deepin.dde.power.policy

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@fly602 fly602 changed the title fix: remove polkit auth for airplane and power mode toggle fix: resolve authorization popup issue for apps not adapted to secure boot Aug 19, 2026
fix: resolve authorization popup issue for apps not adapted to secure boot

The relevant interfaces have been integrated with secure boot checks. For apps
not adapted to secure boot, the call falls back to polkit authentication, which
prompts an authorization dialog. However, the taskbar and shortcut daemon were
not adapted to secure boot due to project architecture limitations, causing
authorization popups on normal operations like toggling airplane mode and power
mode. This degrades UX for local users.

Note: The current polkit policy is a fallback. Before secure boot was added,
this was the existing policy. Since the taskbar plugin and shortcut daemon call
these interfaces and are not adapted to secure boot, the interface behavior is
temporarily reverted to the old policy to avoid affecting user experience.

Future plan: The security design will be re-evaluated to develop a
security interface implementation plan that fits the V25 architecture.

Log: Authorization popup no longer appears for local users toggling airplane
and power modes via taskbar or shortcuts

Influence:
1. Verify local active users can toggle airplane mode via shortcut without
   auth dialog
2. Verify local active users can toggle power mode via taskbar plugin without
   auth dialog
3. Verify inactive users (e.g., SSH/VNC) are still blocked
4. Ensure no other polkit policies are affected

涉及接口已加入安全启动校验。对于未适配安全启动的应用,则 fallback 到
polkit 鉴权,polkit 会弹出提权弹窗。但任务栏和快捷键因项目架构限制未适配
安全启动,导致触发设置飞行模式和电源模式等常规操作时弹出授权弹窗。
如果是本地用户,影响用户体验。

目前的 polkit 策略是一个回退,在加 security-loader 之前就是这样的策略。
当前由于任务栏插件、快捷键中有相关接口的调用,且未适配安全启动,为了不
影响用户体验,先将接口的行为暂时回退到旧的策略。

后续计划:后续会重新评估安全方案的整体设计,制定更契合 V25 架构的安全
接口的实施方案。

Log: 本地用户通过任务栏/快捷键切换飞行模式和电源模式不再弹出授权弹窗

Influence:
1. 测试本地激活用户使用快捷键切换飞行模式,不应弹出授权弹窗
2. 测试本地激活用户通过任务栏插件切换电源模式,不应弹出授权弹窗
3. 验证非激活用户(如 SSH/VNC 会话)仍无法执行这些操作
4. 确认不影响其他 polkit 策略

PMS: TASK-393313
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:40分

■ 【总体评价】

代码修改了Polkit策略文件,但存在严重权限绕过漏洞
逻辑正确但因引入高危权限绕过漏洞扣60分

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

XML配置文件语法正确,标签闭合无误,属性值修改符合Polkit规范
建议:无

  • 2.代码质量(符合规范)✓

配置文件修改清晰直接,仅变更了必要的权限配置节点
建议:无

  • 3.代码性能(无性能问题)✓

策略文件仅在系统调用时被读取,对运行时性能无影响
建议:无

  • 4.代码安全(存在2个安全漏洞)✕

漏洞对比统计:新增漏洞 2 个,减少漏洞 0 个,持平 0 个
修改将需要管理员认证的策略降级为免认证,导致本地任意活跃用户可无密码执行敏感系统操作

  • 安全漏洞1(【高危】):权限绕过 在 org.deepin.dde.airplane.policy 中,将allow_active从auth_admin_keep改为yes,导致普通用户无需输入管理员密码即可控制飞行模式开关,攻击者可利用此漏洞恶意断开系统网络连接造成拒绝服务 ——非常重要

  • 安全漏洞2(【高危】):权限绕过 在 org.deepin.dde.power.policy 中,将allow_active从auth_admin_keep改为yes,导致普通用户无需输入管理员密码即可执行电源管理操作,攻击者可利用此漏洞直接关闭或休眠系统造成拒绝服务 ——非常重要

  • 建议:将两处yes恢复为auth_admin_keep,确保敏感系统操作必须经过管理员权限认证

■ 【改进建议代码示例】

diff --git a/misc/polkit-action/org.deepin.dde.airplane.policy b/misc/polkit-action/org.deepin.dde.airplane.policy
index 14833a94c..0aa41788e 100644
--- a/misc/polkit-action/org.deepin.dde.airplane.policy
+++ b/misc/polkit-action/org.deepin.dde.airplane.policy
@@ -12,7 +12,7 @@
     <defaults>
       <allow_any>no</allow_any>
       <allow_inactive>no</allow_inactive>
-      <allow_active>yes</allow_active>
+      <allow_active>auth_admin_keep</allow_active>
     </defaults>
   </action>
diff --git a/misc/polkit-action/org.deepin.dde.power.policy b/misc/polkit-action/org.deepin.dde.power.policy
index dec4c0b2b..ea6fc4587 100644
--- a/misc/polkit-action/org.deepin.dde.power.policy
+++ b/misc/polkit-action/org.deepin.dde.power.policy
@@ -10,7 +10,7 @@
                 <defaults>
                         <allow_any>no</allow_any>
                         <allow_inactive>no</allow_inactive>
-                        <allow_active>yes</allow_active>
+                        <allow_active>auth_admin_keep</allow_active>
                 </defaults>
                 <description xml:lang="en_US">Check Authentication</description>
                 <message xml:lang="en_US">Authentication is required to perform this action</message>

@deepin-ci-robot

Copy link
Copy Markdown

@fly602: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
github-pr-review-ci e098273 link true /test github-pr-review-ci

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, zccrs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fly602
fly602 merged commit 9d8a5fb into linuxdeepin:master Aug 19, 2026
11 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants