Skip to content

Fix typo in coreshop.security.frontend_regex breaking the pimcore-studio exclusion - #3164

Merged
dpfaffenbauer merged 1 commit into
5.1from
issue/3145
Aug 21, 2026
Merged

Fix typo in coreshop.security.frontend_regex breaking the pimcore-studio exclusion#3164
dpfaffenbauer merged 1 commit into
5.1from
issue/3145

Conversation

@dpfaffenbauer

@dpfaffenbauer dpfaffenbauer commented Aug 21, 2026

Copy link
Copy Markdown
Member

Fixes #3145

Targets 5.1, the oldest affected branch — 2026.x carries the identical typo and picks the fix up through the normal upmerge, so there is no second PR.

Problem

config/packages/security.yaml defines the frontend firewall pattern as:

coreshop.security.frontend_regex: "^/(?!admin|!pimcore-studio)[^/]*"

The second ! is a typo. Inside a negative lookahead the alternation admin|!pimcore-studio matches the literal string !pimcore-studio, so /pimcore-studio was never excluded from the CoreShop frontend firewall pattern.

The symptom is subtle: logging into Pimcore Studio appears to work, but every subsequent /pimcore-studio/api request is anonymous ("No pimcore user found"), because the request can be picked up by the shop firewall with its own (context: shop) session context instead of the Studio one.

Fix

coreshop.security.frontend_regex: "^/(?!admin|pimcore-studio)[^/]*"

Firewall order

Checked as part of the same failure mode, on this branch: pimcore_studio is declared before coreshop_frontend (the classic pimcore_admin firewall above it is commented out), which is correct — Symfony uses the first firewall whose pattern matches. No change needed.

The installation docs only said to add coreshop_frontend "after the other entries", which is now made explicit.

Verification

Mechanical check of both patterns against the relevant paths. The two patterns are read out of the real config/packages/security.yamlbefore from 5.1 as it stands, after from this branch — and matched with preg_match, answering "does this path fall into the CoreShop frontend firewall?":

before (5.1 today)  ^/(?!admin|!pimcore-studio)[^/]*
  FAIL  /pimcore-studio/api/login  frontend firewall: yes (expected no)
  FAIL  /pimcore-studio            frontend firewall: yes (expected no)
  OK    /admin/login               frontend firewall: no  (expected no)
  OK    /en/shop/                  frontend firewall: yes (expected yes)
  OK    /                          frontend firewall: yes (expected yes)

after  (this PR)    ^/(?!admin|pimcore-studio)[^/]*
  OK    /pimcore-studio/api/login  frontend firewall: no  (expected no)
  OK    /pimcore-studio            frontend firewall: no  (expected no)
  OK    /admin/login               frontend firewall: no  (expected no)
  OK    /en/shop/                  frontend firewall: yes (expected yes)
  OK    /                          frontend firewall: yes (expected yes)

Shop paths are unaffected; only /pimcore-studio* changes classification, which is the intent.

Blast radius

Grepped both 5.1 and 2026.x for frontend_regex and for the spelled-out pattern:

Location State
config/packages/security.yaml had the typo on both branches — fixed here on 5.1
docs/01_Getting_Started/00_Installation.md had ^/(?!admin)[^/]*, no Studio exclusion at all, identical on both branches — updated, so anyone following the install guide does not reproduce this bug
src/CoreShop/Bundle/CoreBundle/Resources/config/pimcore/security.yml has the old ^/(?!admin)[^/]* on both branches; this file is stale Symfony-4-era config (anonymous: ~, encoder_factories) that nothing imports. Deliberately left alone — it is a separate cleanup, not part of this fix
CHANGELOG-3.0.x.md historical, untouched

No occurrences in app skeletons, install templates, demo/test app configs, or external-bundle docs.

…dio exclusion

The negative lookahead read (?!admin|!pimcore-studio) - the stray '!' made the
second alternative match the literal string '!pimcore-studio', so /pimcore-studio
was never excluded from the CoreShop frontend firewall pattern.

Also align the installation docs, which never mentioned the pimcore-studio
exclusion at all, and spell out that coreshop_frontend has to be declared after
the pimcore_studio firewall.
@dpfaffenbauer
dpfaffenbauer changed the base branch from 2026.x to 5.1 August 21, 2026 07:23
@sonarqubecloud

Copy link
Copy Markdown

@dpfaffenbauer
dpfaffenbauer merged commit 0e03e92 into 5.1 Aug 21, 2026
8 checks passed
@dpfaffenbauer
dpfaffenbauer deleted the issue/3145 branch August 21, 2026 07:34
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 21, 2026
@dpfaffenbauer dpfaffenbauer added this to the 5.1.0 milestone Aug 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2026.x: typo in coreshop.security.frontend_regex breaks the pimcore-studio exclusion

1 participant