Skip to content

Conversation

@RinZ27
Copy link
Contributor

@RinZ27 RinZ27 commented Jan 8, 2026

Hi, I've updated this PR to include a fix for a potential XSS vulnerability in the idle API sample.

Key Changes:

  1. Security Hardening: Refactored api-samples/idle/history.js to replace insecure .innerHTML usage with safe DOM manipulation (textContent and replaceChildren). This mitigates potential XSS risks from untrusted data in the history log.
  2. Dependency Updates: Bumped @rollup/plugin-commonjs and @rollup/plugin-node-resolve to their latest stable versions across multiple functional samples:
    • functional-samples/ai.gemini-on-device
    • functional-samples/ai.gemini-on-device-calendar-mate
    • functional-samples/ai.gemini-on-device-summarization
    • functional-samples/libraries-xhr-in-sw

These changes ensure the samples follow modern security standards and protect against potential supply chain vulnerabilities.

@google-cla
Copy link

google-cla bot commented Jan 8, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@RinZ27 RinZ27 force-pushed the security/update-outdated-rollup-plugins branch from d25ad72 to f254339 Compare January 8, 2026 05:42
@RinZ27 RinZ27 changed the title security: update outdated rollup plugins to mitigate potential vulnerabilities security: update rollup plugins and fix potential XSS in idle sample Jan 8, 2026
Copy link
Member

@oliverdunk oliverdunk left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. Can you merge with main and remove the package updates? I'd be happy to accept the changes to avoid innerHTML, but we have Dependabot to update packages (we are a little behind on merging those PRs which I will try to do soon).

@RinZ27
Copy link
Contributor Author

RinZ27 commented Jan 8, 2026

Reverted the package updates and merged main as requested. Left the innerHTML fixes as is.

@RinZ27
Copy link
Contributor Author

RinZ27 commented Jan 8, 2026

Added the missing newline as requested.

@oliverdunk oliverdunk merged commit 43a7939 into GoogleChrome:main Jan 8, 2026
2 checks passed
@RinZ27 RinZ27 deleted the security/update-outdated-rollup-plugins branch January 9, 2026 12:53
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.

2 participants