mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
0791b8eef08db8c5eaafbfb3f34fffa478489e0e
Permission checks (CheckStaticCfgPermission, CheckCallServiceExtensionPermission, CheckStartByCallPermission) used to read SKILL_EXECUTE_PARAM_CALLER_TOKEN_ID straight out of the Want that flows through GenerateAbilityRequest. Because Want is attacker controlled on the public StartAbility paths, a forged callerTokenId could route the skill-specific permission branches in PermissionVerification (CheckSkillStartByCallPermission, JudgeInvisibleAndBackground) and borrow another app's identity. Add a dedicated AbilityRequest::skillCallerTokenId field populated solely by the trusted skill entrypoints: - ExecuteInAppSkill / ExecuteInAppSkillWithTokenId drop the want.SetParam calls and pass callerTokenId through to StartAbilityByCallWithSkill / StartExtensionAbilityWithSkill. - Those two helpers (and StartExtensionAbilityInner via a new optional parameter) set the AbilityRequest field after the request is generated. - The three permission checks now read abilityRequest.skillCallerTokenId instead of the Want. Forged Want params no longer influence permission decisions. Existing callers of StartExtensionAbilityInner are unaffected via the default parameter value. Co-Authored-By: Agent Signed-off-by: RuiChen_01 <chenrui193@huawei.com> 🤖 AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: claude (glm-5.2) <ai@local>
Description
暂无描述
Languages
C++
98.1%
C
1.5%
JavaScript
0.2%
TypeScript
0.1%