Skip to content

Rhoerr PRs integration#102

Merged
vpietri merged 39 commits into
mainfrom
rhoerr_fixes
May 19, 2026
Merged

Rhoerr PRs integration#102
vpietri merged 39 commits into
mainfrom
rhoerr_fixes

Conversation

@vpietri

@vpietri vpietri commented Apr 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

rhoerr and others added 30 commits April 5, 2026 18:04
- Add isToolbarAccessAllowed() guard to all 6 unguarded plugins
- Cache guard result per-request to avoid repeated config lookups
- Block toolbar activation entirely in production mode
- Change default enable from 2 (IP-restricted) to 0 (disabled)
- Remove stray dump() call in SearchClient plugin
- Add dev/debug keywords to composer.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Implement CsrfAwareActionInterface on all 5 action controllers
- Add HttpPostActionInterface to restrict to POST method
- Allowlist cookie names in Cookie controller (C1)
- Remove devadmin config key from ConfigUpdate (C3)
- Fix exception catches to use \Throwable (H9)
- Update toolbar JS to send POST with FORM_KEY

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Restrict phpinfo() to exclude $_ENV and $_SERVER (H2)
- Mask sensitive/environment config paths via TypePool + denylist (H3)
- Remove session ID from Request tab (H5)
- Mask customer email to domain only (M3)
- Redact admin backend URL (M4)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Escape all variable output in templates with escapeHtml/escapeHtmlAttr/escapeUrl
- Rewrite formatSql() to escape input before applying syntax highlighting
- Escape IDE link helper HTML output with htmlspecialchars
- Replace innerHTML with textContent in log viewer
- Remove executeScriptElements() (re-activates scripts from AJAX HTML)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move all 4 observers from global etc/events.xml to area-specific
etc/frontend/events.xml and etc/adminhtml/events.xml. Observers
no longer fire on REST API, GraphQL, CLI, or cron requests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Require isToolbarAccessAllowed() before enabling profiler (H4)
- Change ObjectManager::create() to get() in Profiler/Db to avoid
  constructing ~300 Cookie instances per page load (M10)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace ObjectManager usage with constructor DI in Toolbar and Panel
- Inject SerializerInterface in Helper/Data, fix and→&& operators
- Hash session IDs in temp filenames, add cleanup in shutdown path
- Fix cache dedup bug ($cacheEvents → $this->cacheEvents)
- Migrate static CSP hashes to SecureRenderer nonces
- Guard reflection calls with try/catch \ReflectionException
- Remove dead Response plugin
- Fix Elasticsearch pullData() return type
- Scope window.fetch monkey-patch in dumper.phtml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use TypePool::isPresent() with TYPE_SENSITIVE/TYPE_ENVIRONMENT constants
  (isValueSensitive/isValueEnvironment do not exist on TypePool)
- Remove hasShortWhat() ternary that could bypass phpinfo filtering

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix unreachable else branch by adding explicit $file existence check
- Fix typo: "reseted" → "reset"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restore @param phpdocs on public plugin methods that were removed
during the guard-pattern refactor. Plugin method signatures follow
Magento conventions and benefit from explicit documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The comment explains WHY the Cache-Control header is set (to control
varnish, fastly, and built-in php page caches), which is not obvious
from the code alone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both validateForCsrf() and createCsrfValidationException() returned null,
which is identical to the default behavior for any action that does NOT
implement CsrfAwareActionInterface. HttpPostActionInterface alone is
sufficient — it restricts routes to POST, and the framework's CsrfValidator
applies standard form_key validation to all POST actions by default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Curly/smart quotes (U+2018, U+2019) were introduced in the catch
handler string. Replace with straight ASCII quotes for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous commit removed executeScriptElements and its call as a CSP
hardening measure. However, four tab templates (log, action, profiler,
dumper) contain inline <script> blocks that are loaded via AJAX into
innerHTML. Browsers do not execute scripts set via innerHTML, so
executeScriptElements (which clones script elements to force execution)
is required for those tabs to function.

Removing executeScriptElements is a valid goal but requires refactoring
all tab templates to use event-delegation or post-load initialization
instead of inline scripts — out of scope for this XSS sweep.

The stray this.log() debug call has been removed from the restored method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Without explicit argument override, UrlInterface resolves to
Backend\Model\Url in the adminhtml area, breaking frontend URLs
generated by Toolbar and Panel blocks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The method indiscriminately deletes temp files older than 20s,
which can destroy other sessions' data. It was never called before
PR7 added it, and the TODO in cleanOldFiles() itself notes it
needs scoping to the current session before use.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All plugins previously injected Helper\Data just to call
isToolbarAccessAllowed(). Since Helper\Data extends AbstractHelper
(which pulls in EventManager, Session, etc.), this created circular
dependency chains with plugins on bootstrap-path classes like
EventManagerInterface, InvokerInterface, CacheInterface, and
Zend_Db_Adapter_Abstract.

New Service\AccessChecker has minimal dependencies (State, ScopeConfig,
RemoteAddress, HttpHeader) that don't trigger any of the intercepted
classes. It also includes:
- Per-request result caching (single lookup shared by all plugins)
- Re-entrancy guard for config reads that trigger cache/DB operations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Require AccessChecker.isToolbarAccessAllowed() before enabling profiler (H4)
- Change ObjectManager::create() to get() in Profiler/Db to avoid
  constructing ~300 Cookie instances per page load (M10)
- Use AccessChecker (introduced in PR1) instead of Helper\Data to avoid
  circular dependency through Session\Generic

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Panel gained a UrlInterface $frontUrl constructor parameter when
ObjectManager::get() was replaced with proper DI injection. Six
subclasses that override the constructor were not updated to accept
and forward this parameter, causing DI compilation errors:
"Incompatible argument type: Required UrlInterface. Actual: array"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vpietri vpietri changed the title Rhoerr fixes Rhoerr PRs integration Apr 29, 2026
@vpietri vpietri merged commit 595031f into main May 19, 2026
1 check passed
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.

2 participants