合并受阻
开始进行AI检视!
AI review has been started, please wait...


| check type | result | report |
|---|---|---|
| start ai_review | pass | - |


感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。
Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.


⚠️ 🤖 AI 代码检视报告 ⚠️
总体评估: NEEDS_ATTENTION
问题统计:
- 总问题数: 2
- 严重问题: 0
- 高危问题: 0
摘要:
PR支持SA拉起常驻应用,但将bundleName直接作为callerName绕过权限校验的设计存在潜在安全风险,且测试用例存在变量遮蔽问题。
📊 详细报告
查看完整的审查详情,包括具体的问题描述、建议和代码位置:
🔗 查看详细报告
此评论由 OpenHarmony Insight 代码审查系统自动生成


🤖 AI 代码检视意见(回复本评论可解决检视意见,点击被检视代码行左侧的小头像可收起检视意见)
🟡 SA调用者通过bundleName绕过权限校验存在安全风险
位置: L16186-L16193 | 严重程度: Medium
❓ 问题描述
在 SetResidentProcessEnabled 中,当 isSACall 为 true 时,直接将 bundleName 赋值给 callerName。由于后续 VerifyConfigurationPermissions 会使用 callerName 进行权限校验,这种做法等同于让任意 System Ability (SA) 能够绕过应用级别的权限校验,对任意 bundleName 的常驻进程进行启停操作。如果 IsSACall() 的判定过于宽泛,或者某个 SA 被攻破,将导致非预期的应用被拉起或系统资源耗尽。
💡 修复建议
修改建议:确认 IsSACall() 是否对 SA 调用者进行了严格的身份校验。当前实现允许任意 SA 通过传入任意 bundleName 绕过 VerifyConfigurationPermissions 校验。建议在代码中补充安全设计说明,或为 SA 调用者增加更细粒度的权限校验,避免非预期 SA 滥用此接口。
16186: if (isSACall) {
16187: // SA process is not managed by appmgr, use bundleName as callerName to pass permission check.
16188: // 建议:增加对特定SA权限的校验,或在注释中明确说明此操作的安全前提。
16189: callerName = bundleName;
16190: } else {


感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。
Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.


static-check


静态检查:
| # | check type | result | report |
|---|---|---|---|
| 1 | codeCheck | pass | >>> |


感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。
Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.


static-check


静态检查:
| # | check type | result | report |
|---|---|---|---|
| 1 | codeCheck | pass | >>> |


感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。
Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.


static-check


静态检查:
| # | check type | result | report |
|---|---|---|---|
| 1 | codeCheck | pass | >>> |


感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。
Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.


IssueNo:
https://gitcode.com/openharmony/ability_ability_runtime/issues/16136
Description:
常驻应用按需拉起支持SA
稳定性自检:
安全编码自检:
TDD Result:
XTS Result:
是否已执行L0用例
AI检视评分(使用本地代码检视skills扫描):