Skip to content

[Bug] CoreUI theme 1.2.0+ adds integrity attributes to @basset() CDN assets, incompatible with Basset 2.x (Backpack 6) #6090

Open

Description

@mrinaldidfs

Bug report

Please note: All issues must be submitted in English. If not, they will be closed automatically.

What I did

I installed Backpack 6 and updated the project's PHP packages from PHP 8.2 to PHP 8.4. This update also upgraded the backpack/theme-coreui package from version 1.1.6 to version 1.2.7.

What I expected to happen

The theme's CDN assets (Bootstrap, CoreUI, SimpleBar JS) should load correctly through @basset(), exactly as they did with theme version 1.1.6.

What happened

Starting from backpack/theme-coreui 1.2.0, the theme views add the CDN assets via @basset() with an explicit integrity and crossorigin attribute, e.g.:

@basset('https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js', true, ['integrity' => 'sha256-m81NDyncZVbr7v9E6qCWXwx/cwjuWDlHCMzi9pjMobA=', 'crossorigin' => 'anonymous'])
@basset('https://unpkg.com/@coreui/coreui@4.2.6/dist/js/coreui.min.js', true, ['integrity' => 'sha384-7z/8kRsWn+JzUhcmd/7if4xTkhFHSa91GbgPGNPuOACOF6hhbxLeSAX0OhEy5ug9', 'crossorigin' => 'anonymous'])
@basset('https://unpkg.com/simplebar@6.2.7/dist/simplebar.min.js', true, ['integrity' => 'sha384-IiaRtt+2y5xh3HH+L4JkT7GRvNJgAnAHTOPt2/WWXW4sWqqQcBmQNlVFTWUQhkEp', 'crossorigin' => 'anonymous'])

However, basset/basset 2.x (the version required by Backpack 6) downloads the remote asset and serves it locally from storage/basset/..., without recomputing or stripping the integrity attribute to match the locally cached file's actual hash.

As a result, the browser receives the original third-party integrity hash (computed against the CDN-hosted file) together with a URL pointing to the locally mirrored copy, whose real SHA-256 digest is different. The browser then rejects the resource with Subresource Integrity (SRI) errors, for example:

Failed to find a valid digest in the 'integrity' attribute for resource
'https://caponi.dev-app.it/storage/basset/cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js'
with computed SHA-256 integrity '/oSDWQ2P/y1WB9iwQNnnjyRCC/eLNtEqqDJEfsW8clU='.
The resource has been blocked.

This breaks Bootstrap, CoreUI and SimpleBar JS on every page using the CoreUI theme, since the scripts are silently blocked by SRI validation (dropdowns, sidebar toggle, and other UI interactions stop working).

What I've already tried to fix it

Manually removing the integrity and crossorigin arguments from the @basset() calls in the published theme views resolves the issue, which confirms the hash mismatch between the integrity attribute and the locally cached asset is the root cause.

Is it a bug in the latest version of Backpack?

After I run composer update backpack/crud the bug... is it still there?

Yes, the issue persists on the latest backpack/crud version — it originates in backpack/theme-coreui (1.2.0+) combined with basset/basset 2.x, not in backpack/crud itself.

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

### PHP VERSION:
8.4.27

### PHP EXTENSIONS:
Core, date, libxml, json, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, SPL, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, session, standard, openssl, mbstring, igbinary, imagick, imap, intl, ldap, exif, mongodb, mysqlnd, mysqli, pcntl, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, Phar, posix, random, readline, redis, Reflection, shmop, SimpleXML, soap, sockets, sodium, sqlsrv, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zstd, herd, ZendOPcache

### LARAVEL VERSION:
12.70.1.0

### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.3.10
backpack/crud: 6.8.17
backpack/editable-columns: 3.0.11
backpack/generators: v4.0.7
backpack/pro: 2.2.37
backpack/theme-coreuiv4: 1.2.7

<img width="701" height="248" alt="Image" src="https://github.com/user-attachments/assets/90dc5812-ba5a-4e20-bb25-e17c84eab114" />

Additional Information

Here's some more info that could be helpful in reproducing or debugging:

  • Environment details (e.g., operating system, web server, browser): PHP 8.4, backpack/theme-coreui 1.2.7 (regression starts at 1.2.0; 1.1.6 was not affected), basset/basset 2.x
  • Relevant error logs or screenshots (if any): Browser console SRI errors as shown above, reproducible on every page that loads the CoreUI theme assets

Note: Issues that cannot be reproduced or lack necessary details to diagnose could be closed.

Activity

  1. backpack-ai-bot commented on Oct 23, 2026

    @backpack-ai-bot

    AI Answer:

    🚨 Bot is not sure about this answer. Please verify. 🚨

    This is not documented in the available Backpack resources. Based on the report, this appears to be a valid compatibility bug: an SRI hash for the CDN response cannot validate a locally mirrored Basset file unless Basset preserves identical bytes or recomputes/removes integrity.

    • The reported package output lists backpack/basset: 1.3.10, not basset/basset 2.x; verify the actual dependency/package naming before filing.
    • A reproducible fix should be made upstream: either omit SRI attributes for assets that Basset localizes, or have Basset generate integrity hashes for its cached local files.
    • Do not edit published vendor views as a durable fix; overrides may be replaced on package updates.
    • Backpack has continued maintenance and bug fixes in recent releases, but the documentation provided does not confirm this specific issue or its status. [7][8]

    ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️

    Relevant sources:

    Progress Report: January 2024 > Maintenance
    Progress Report - December 2023 > Maintenance

  2. mrinaldidfs commented on Oct 23, 2026

    @mrinaldidfs
    ContributorAuthor

    Sorry for the typo in my original report — I wrote basset/basset 2.x, but the correct package is of course backpack/basset. Thanks for catching that.

    To be precise, my installed version is:

    backpack/basset: 1.3.10

    (please replace with the actual version if different — check with composer show backpack/basset)

    The behavior described in the report is unchanged: backpack/basset serves CDN assets locally from storage/basset/... without recomputing or stripping the integrity attribute that backpack/theme-coreui (1.2.0+) now passes to @basset(), which causes the browser to reject the asset due to an SRI hash mismatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions