Skip to content

add google drive - #41

Open
frederic34 wants to merge 13 commits into
mainfrom
dev
Open

add google drive#41
frederic34 wants to merge 13 commits into
mainfrom
dev

Conversation

@frederic34

Copy link
Copy Markdown
Contributor

No description provided.

frederic34 and others added 13 commits July 29, 2026 14:14
Add GOOGLEAPI_CONTEXTS_TO_SEND setting with per-context enable/disable
in setup.php, add an ecmfiles extrafield for googleapiId, fix rights
labels, extend token expiry buffer to 60s with better error catching,
enable the scheduled watch cron job by default, and misc small fixes
across oauth callback, actions and tabs.
The jqueryFileTree plugin is not loaded globally by Dolibarr core, so
jQuery('#filetree').fileTree() threw "not a function" and aborted the whole
ready handler, leaving both the folder tree and the file list empty.

Load the plugin from $morejs before our own JS, using the same path as
htdocs/ecm/index.php. Also load the file list before initializing the tree
and wrap the tree init in a try/catch, so a tree failure can no longer take
the file list down with it.
Google Drive file and folder names are attacker-controlled: anybody sharing a
folder with the connected account picks its name.

Breadcrumb: the name was concatenated into a string injected with .html(), so
a folder named "<img src=x onerror=alert(1)>" ran script on every re-render.
Escape it through a text node first.

onclick handlers: dol_escape_js() protects the JS string literal but not the
surrounding HTML attribute, and the browser HTML-decodes the attribute before
parsing it as JS. A name containing "&#39;" therefore became a real quote and
broke out of the argument. Build the handler first, then HTML-escape it as a
whole.

Uses dol_escape_htmltag($s, 0, 0, '', 1): in its default mode
dol_escape_htmltag() re-emits the literal sequence "&#39;" untouched (it hides
it behind __SIMPLEQUOTE__ so htmlentities() never encodes the &), which leaves
exactly this attack open. $escapeonlyhtmltags=1 has no such carve-out.
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