Problem/Motivation

The keepeek/keepeek_library is loaded unconditionally into keepeek_preprocess_page, and the complete original Keepeek configuration is also pushed under drupalSettings.keepeek. This data (including API credentials) is therefore accessible on all pages, whether public or admin, which might be considered as a security issue. This also results in an unnecessary overhead of 1.6 MB on public routes.

Steps to reproduce

With Keepeek module enabled, while browsing any page, open the browser's dev tools and check for the presence of the resource https://cdn.jsdelivr.net/npm/@keepeek/keepicker-react@1/dist/index.min.js. In the console, you can also inspect the content of drupalSettings.keepeek and, by editing the DOM, add the kpk-keepicker web component and observe its initialization.

Proposed resolution

I suggest removing keepeek_preprocess_page in favor of loading keepeek/keepeek_library and setting drupalSettings.keepeek on KeepeekMediaForm build.

Issue fork keepeek-3558769

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alex.druhet created an issue. See original summary.

alex.druhet’s picture

Status: Active » Needs review
keepeek_dam’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

keepeek_dam’s picture

Version: 1.1.x-dev » 1.1.5
Status: Fixed » Closed (fixed)