Skip to content

fix(security): upgrade zotero-plugin-toolkit to 6.0.0 - #322

Closed
POBrien333 wants to merge 32 commits into
windingwind:mainfrom
POBrien333:fix/toolkit-6-remove-protocol-bridges
Closed

POBrien333 wants to merge 32 commits into
windingwind:mainfrom
POBrien333:fix/toolkit-6-remove-protocol-bridges

Conversation

@POBrien333

Copy link
Copy Markdown

Summary

A security scan of the built XPI flagged two zotero:// protocol bridges registered by zotero-plugin-toolkit 5.1.0-beta.13:

  • zotero://plugin: a web page could make Zotero install add-ons without a prompt (medium)
  • zotero://ztoolkit-debug: a link could run code if the user approved a prompt (medium)

Toolkit 6.0.0 removes both.

Changes

  • zotero-plugin-toolkit ^5.1.0-beta.13 → ^6.0.0
  • 6.0 no longer exports the all-in-one ZoteroToolkit. src/utils/ztoolkit.ts now uses a minimal BasicTool subclass covering only what the plugin uses: getGlobal, log, basicOptions, unregisterAll. Unused UI log options and the ProgressWindow icon setup are removed. typings/global.d.ts derives its type from createZToolkit, so it needed no change.

Verification

  • npm run build (bundle + tsc --noEmit) passes
  • Built bundle contains no zotero://plugin, ztoolkit-debug or _extensions[ registrations (0 matches)
  • Prettier + ESLint clean on changed files
  • Manual: load the XPI in Zotero 7, verify a license, install a style, and check that "Copy Logs" still shows prefixed entries

🤖 Generated with Claude Code

POBrien333 and others added 30 commits March 10, 2026 08:01
The zotero-plugin-scaffold template() function calls str.matchAll(),
which requires all build.define values to be strings. The author field
was passing the full author object from package.json instead of just
the name string, causing a TypeError.

Changed author: pkg.author to author: pkg.author.name to fix this.
Rename the plugin from 'My Custom Styles' to 'Citation Styler Client Sync'
and update the repository name to 'citationstyler-client-sync'.

Changes:
- Updated package.json: name, addonName, addonID, addonRef, addonInstance,
  prefsPrefix, and repository URL
- Updated all localization IDs from 'mycustomstyles-*' to 'citationstyler-sync-*'
- Updated all documentation (README.md, CLAUDE.md, doc/README-deAT.md)
- Updated addon manifest references and preferences template
- Updated TypeScript i10n type definitions
- Updated .ftl localization file prefixes
Updated all user-visible plugin display strings across English and German
locales to use the 'Citation Styler' brand name instead of 'My Custom Styles'
or 'Meine Zitierstile'. This affects:

- Zotero preferences sidebar label (prefs-title)
- Preferences pane heading (citationstyler-sync-prefs-title)
- Main window menu item (citationstyler-sync-menu-item-label)
- Startup status messages (startup-begin, startup-finish)

'Citation Styler' is kept unchanged in German as a proper product name
(standard practice for brand names across languages).
When a user verifies credentials but no styles are available, the previous
message 'Could not load styles. Check your connection.' implied a connectivity
issue and made users think they made a mistake. This can occur when styles
haven't been configured on the server for their license.

Changed the message to 'Style(s) not available. Please contact support at
info@citationstyler.com.' to make it clear this may be a backend issue
requiring support intervention, reducing customer confusion and support tickets.
… bump

- Add src/utils/theme.ts with isDarkMode() and getColors() helpers
- Update customStyles.ts and hooks.ts to use theme-aware colors for all JS-rendered UI
- Add white favicon variant for dark mode sidebar icon
- Rename prefs pane heading to 'Citation Styler Client Sync' and inject version number (e.g. v1.0.1) via JS
- Bump zotero-plugin-scaffold from 0.8.2 to 0.8.5

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add src/utils/logger.ts with in-memory log buffer (csLog, getFormattedLogs)
- Replace ztoolkit.log calls with csLog throughout hooks.ts, license.ts, customStyles.ts
- Add INFO/WARN breadcrumbs at key lifecycle points for richer diagnostics
- Add 'Copy Logs' button in prefs alongside Verify/Clear buttons
- Bump version to 1.0.2
- Add changelog to README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch API_BASE from staging.citationstyler.com to citationstyler.com
- Fix Prettier formatting across all recently modified files (lint CI fix)
- Upgrade actions/upload-artifact from v4 to v5 (resolve Node.js 20 deprecation)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Zotero's style registry is not immediately queryable after
zotero.Styles.install() resolves, so getStyleStatus() would still
return "not-installed" on the next render() call. Track styles
installed in the current session with a local Set and pass it to
buildStyleRow so the button immediately reflects the correct state.
…dating

fix: install button stays on Install after style is installed
chore: support Zotero 10 (bump strict_max_version to 10.*)
POBrien333 and others added 2 commits May 22, 2026 09:56
Toolkit 5.x registered the zotero://plugin and zotero://ztoolkit-debug
protocol bridges, which let a web page trigger add-on installs or code
execution via zotero:// links. 6.0.0 removes them.

6.0 drops the all-in-one ZoteroToolkit export, so replace it with a
minimal BasicTool subclass covering what the plugin actually uses
(getGlobal, log, unregisterAll).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@POBrien333

Copy link
Copy Markdown
Author

Opened against the wrong repository by mistake, sorry for the noise.

@POBrien333 POBrien333 closed this Nov 6, 2026
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.

1 participant