π‘οΈ Sentinel: [HIGH] Fix user activation bypass in AI hooks - #68
π‘οΈ Sentinel: [HIGH] Fix user activation bypass in AI hooks#68galiprandi wants to merge 1 commit into
Conversation
- Re-enable navigator.userActivation.isActive checks in useAIPrompt and useAISummarize to prevent background resource consumption and fingerprinting. - Implement base constructor checks (Object, Array, Function) in AI initialization paths to prevent false positives from global object matching. - Update test suites to stub user activation and verify enforcement.
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Closing as superseded by #72, which includes all these changes plus additional SSR-safe guards and LanguageDetector validation. Already merged into main. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
π¨ Severity: HIGH
π‘ Vulnerability: The
useAIPromptanduseAISummarizehooks had user activation checks commented out to allow for model "warmup". This allowed AI models to be initialized without explicit user consent, potentially enabling fingerprinting or unauthorized resource consumption. Additionally, these hooks lacked checks to ensure that the retrieved AI API global objects were not generic base constructors.π― Impact: Malicious scripts could trigger expensive model downloads or use AI APIs for fingerprinting without any user interaction. Lack of constructor validation could lead to false positives or errors if global names matched plain objects.
π§ Fix:
navigator.userActivation.isActivechecks inuseAIPrompt.tsanduseAISummarize.ts.LanguageModelandSummarizerglobals are notObject,Array, orFunction.useAIPrompt.test.tsanduseAISummarize.test.tsto reflect the mandatory activation requirement.β Verification:
pnpm test lib/hooks/useAIPrompt.test.ts(14/14 passed).pnpm test lib/hooks/useAISummarize.test.ts(22/22 passed).pnpm test lib/hooks/useAI.test.tsto ensure no regressions in centralized API detection (16/16 passed).PR created automatically by Jules for task 14060104763707794969 started by @galiprandi