A11y scan hardening: block non-AJAX mobile nav callback access - #5642
A11y scan hardening: block non-AJAX mobile nav callback access#5642accesswatch wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Hardens the az_core.mobile_nav_callback controller endpoint so it only serves Drupal AJAX command payloads to legitimate AJAX requests, reducing accessibility scanner false-positives caused by crawlers treating the callback response as a standalone page.
Changes:
- Inject
request_stackintoMobileNavController. - Reject non-AJAX requests by throwing
NotFoundHttpException(404) before building the AJAX response.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Tugboat has finished building the preview for this pull request! Link: Dashboard: |
|
The proposed solution does not appear to work. Try clicking on this and observe that you don't get a 404: https://pr5642-n4xghjxwthnpt0xaj2ad8ovkksksbpgg.tugboatqa.com/az_core/mobile_nav_callback/main/Main%20Menu. The isXmlHttpRequest() method merely checks for a |
Summary
Issue types targeted from CSV
html-has-langdocument-titlelabelThese were reported on
/az_core/mobile_nav_callback/...URLs where scanners treated AJAX payloads as full pages.Change
modules/custom/az_core/src/Controller/MobileNavController.phprequest_stackand checksisXmlHttpRequest().404for non-AJAX requests.Impact