MCP server CSS pointer-events:none consent security
Four SA-CSS-PTN consent attack patterns using pointer-events:none and related interaction-suppression properties to subvert MCP server consent dialogs. Unlike visibility or opacity attacks that target what the user can see, pointer-events attacks target what the user can do. A consent dialog that is fully visible, correctly colored, and properly sized fails to provide informed consent if the user cannot click the Allow button, if clicking the Allow button triggers a different action, or if the consent confirmation is entirely non-functional on mobile devices.
The CSS pointer-events property controls whether an element can be the target of pointer device events: mouse clicks, touch events, and hover. Setting pointer-events:none on an element makes it completely transparent to pointer interaction — clicks and touches pass through it to whatever element is directly behind it in the rendering stack. The element remains fully visible and accessible to screen readers; the DOM structure is unchanged; and getComputedStyle(el).pointerEvents returns “none”, which is detectable. However, most visual audits and user testing protocols do not attempt programmatic clicks on consent buttons, making this class of attack resilient to typical review processes. The related touch-action property adds a mobile-specific dimension: it controls browser touch gesture handling separately from pointer events, creating attacks that affect only touch-based devices.
SA-CSS-PTN-001: pointer-events:none on consent dialog container
Applying pointer-events:none to the consent dialog container or the Allow button itself makes the entire interactive surface of the dialog non-responsive to pointer input. The dialog is visible and correctly rendered, but every click and touch event passes through it to the element behind. Users who attempt to click the Allow button see no response — no hover effect, no pressed state, no action. This is particularly confusing because the button appears normal and there is no error message. Users often interpret an unresponsive button as a slow network or a UI glitch and attempt to click multiple times.
.consent-dialog {
pointer-events: none;
}
/* Effects:
- All mouse events (click, mousedown, mouseup, mousemove) on the dialog: not fired
- All touch events (touchstart, touchend, touchmove) on the dialog: not fired
- hover state (:hover pseudo-class): never applied
- cursor: does not change over the dialog (no pointer cursor on buttons)
- The dialog is fully visible — opacity:1, visibility:visible, display:block
- The dialog occupies its layout box normally
User experience: user sees a normal consent dialog with a visible Allow button.
Clicking the Allow button produces no visual feedback and no action.
The click passes through to whatever element is behind the dialog in z-order.
If there is nothing interactive behind: click disappears into void.
Keyboard access: pointer-events:none does NOT affect keyboard navigation.
Tab key can focus elements within the dialog.
Enter/Space on a focused button fires the click event normally.
→ Attack evades keyboard-only accessibility tests.
Screen reader: pointer-events:none is invisible to ARIA and accessibility APIs.
→ Attack evades screen reader and accessibility tree audits.
getComputedStyle(el).pointerEvents returns "none" → directly detectable.
However: detection requires checking the consent dialog AND all its ancestors,
since pointer-events:none on a parent overrides children.
Detection:
For each element in the consent dialog (Allow button, checkboxes, links):
Walk up the ancestor chain checking getComputedStyle(ancestor).pointerEvents.
If any ancestor has pointer-events:none → HIGH SA-CSS-PTN-001.
Also check the dialog container element itself directly. */
Keyboard bypass: pointer-events:none only suppresses pointer device interaction. A user who navigates with Tab and activates the Allow button with Enter will successfully trigger the click handler. This means the attack is not a complete consent bypass for keyboard users, but it completely prevents mouse and touch confirmation — the dominant interaction modality for install dialogs. An audit that uses element.click() programmatically will also bypass the attack, since programmatic click() is not a pointer event. Detection must check the CSS property directly, not attempt a click.
pointer-events:none on consent dialog container: dialog visible, all pointer interaction suppressed; clicks and touches pass through to elements behind. Keyboard (Tab+Enter) unaffected. Detection: check getComputedStyle on consent dialog and all ancestors for pointer-events:none → HIGH.SA-CSS-PTN-002: transparent overlay button with different action
This is the most direct pointer-events attack: an invisible button is positioned over the visible Allow button at exactly the same coordinates. The visible Allow button has pointer-events:none (making it unclickable), while the invisible overlay button has pointer-events:auto (default, capturing all clicks) and executes a different action — typically dismissing the consent dialog without granting permission, or triggering an action the user did not intend. The user sees the Allow button, clicks it, and a different action fires. The UI gives no indication that anything unexpected occurred.
.allow-button {
pointer-events: none; /* real Allow button: unclickable */
}
.shadow-deny-button {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0; /* same bounding box as .allow-button */
opacity: 0; /* invisible */
pointer-events: auto; /* captures all clicks in this area */
z-index: 999;
cursor: pointer;
}
/* Attack mechanics:
User sees: .allow-button (visible, styled as a normal Allow button)
User clicks: the click event fires on .shadow-deny-button (transparent, z-index:999)
Action: .shadow-deny-button triggers deny/dismiss, NOT the grant/allow action.
.shadow-deny-button properties:
- opacity:0: fully invisible to users
- pointer-events:auto: receives all pointer events in its bounding box
- z-index:999: stacked above .allow-button in hit-testing order
- cursor:pointer: cursor changes on hover (subtle signal something is there)
→ cursor change may be removed to make the overlay completely invisible
.allow-button with pointer-events:none:
- Clicks pass through to .shadow-deny-button (which is also at the same position)
- Even without pointer-events:none on .allow-button, z-index:999 ensures
.shadow-deny-button receives the click first.
Detection requires checking for:
1. Elements with opacity:0 or visibility:hidden that have pointer-events != "none"
2. Such elements that overlap (by bounding box) with visible consent UI elements
3. The action triggered by the invisible element differs from the visible element
JavaScript detection approach:
const overlays = [];
for (const el of document.querySelectorAll('*')) {
const s = getComputedStyle(el);
const isInvisible = parseFloat(s.opacity) < 0.1 || s.visibility !== 'visible';
const isClickable = s.pointerEvents !== 'none';
if (isInvisible && isClickable && el.getBoundingClientRect().width > 0) {
overlays.push(el);
}
}
// Check if any overlay bounding box overlaps a visible consent button → CRITICAL */
Invisible clickable elements: An element with opacity:0 and pointer-events:auto is the most evasive form of UI redressing. It is invisible to the user, absent from visual audits, and its presence can only be detected programmatically. Any security audit of MCP consent dialogs must include a scan for invisible (opacity < 0.1 or visibility:hidden) elements that retain pointer interactivity and overlap visible consent buttons. This combination has no legitimate use case in a consent dialog and should always be flagged as CRITICAL.
opacity:0) positioned button with pointer-events:auto overlapping visible Allow button; real Allow button has pointer-events:none; user clicks visible button, invisible button triggers different action. Detection: opacity < 0.1 + pointer-events != none + bounding-box overlap with consent button → CRITICAL.SA-CSS-PTN-003: clickjacking — consent Allow button under transparent UI overlay
Classic clickjacking applied to the consent flow: the consent dialog is positioned with a negative or low z-index so it is rendered behind other content, while a transparent element with a higher z-index sits above it at exactly the same position. The transparent element resembles normal UI (a button, a card, a form field). When the user clicks the normal-looking UI element, the click propagates through to the consent Allow button beneath it. The user has consented without realizing it; the visible interaction was with a different UI element.
.consent-dialog {
position: fixed;
z-index: -1; /* behind all other content */
top: 200px; left: 300px; /* positioned to align Allow button under common target */
}
.fake-ui-button {
position: fixed;
top: 200px; left: 300px; /* exactly overlapping consent Allow button */
z-index: 1000;
opacity: 0.01; /* nearly invisible, but above consent dialog */
cursor: pointer;
width: 120px; height: 44px; /* same size as Allow button */
}
/* Attack mechanics:
.consent-dialog z-index:-1: rendered below all positioned content.
.fake-ui-button z-index:1000: rendered above everything.
.fake-ui-button opacity:0.01: nearly invisible (0.01 retains pointer events;
opacity:0 would too — opacity never prevents pointer events by itself).
Click routing:
User clicks on .fake-ui-button coordinates.
Browser hit-tests: topmost element at those coordinates with pointer-events != none.
.fake-ui-button (z-index:1000, opacity:0.01): receives click.
If .fake-ui-button has pointer-events:none: click passes through to next element.
Next element at those coordinates: Allow button inside .consent-dialog.
→ consent is granted.
Variant: .fake-ui-button is a legitimately styled UI button (e.g., "View Details →").
User intentionally clicks "View Details", which is also the Allow button for consent.
No suspicious invisibility — just two overlapping interactive elements.
Detection:
Check for consent dialog elements with z-index < 0 (behind normal content).
Check for consent Allow button: does any other interactive element occupy the
same bounding box at a higher z-index?
Use document.elementsFromPoint(x, y) at the Allow button center:
if the topmost element is NOT the Allow button → CRITICAL SA-CSS-PTN-003. */
Classic clickjacking variant: SA-CSS-PTN-003 is the CSS implementation of the canonical iframe-based clickjacking attack — but applied within a single document rather than across frames. Because it operates in the same DOM, same-origin restrictions do not apply. The consent dialog is a legitimate element in the page; only its z-index and positional relationship to the overlay make it an attack. Detection must go beyond CSSOM inspection to bounding-box hit-testing: document.elementsFromPoint() at the consent Allow button center should return the Allow button as the topmost element. If it does not, there is an intervening overlay.
z-index:-1; transparent UI overlay at same position with higher z-index captures clicks; user clicks visible UI element, consent Allow button receives click. Detection: document.elementsFromPoint() at Allow button center must return Allow button as topmost element; if not → CRITICAL.SA-CSS-PTN-004: touch-action:none on mobile consent confirm button
The CSS touch-action property specifies which touch gestures the browser should handle natively for an element. Setting touch-action:none tells the browser to suppress all native touch handling for that element — scroll, pan, pinch-to-zoom, and, critically, the tap gesture that would fire a click event. When touch-action:none is applied to a consent confirm button without a corresponding JavaScript touchend event handler, mobile users who tap the button receive no response. The button appears functional but is unresponsive on any touch-based device. Desktop mouse clicks are unaffected, making this a device-specific attack that is invisible during desktop testing.
.consent-confirm-button {
touch-action: none; /* disables browser touch event handling */
}
/* touch-action mechanics:
touch-action:none prevents the browser from generating the following events
for touches starting on this element:
- click (generated from a tap gesture)
- pointerup, pointerdown (pointer events from touch)
- mousedown, mouseup (compatibility mouse events from touch)
The element still receives touchstart events, but without browser gesture
recognition, no click event is fired.
Desktop behavior: pointer-events from a mouse are unaffected by touch-action.
A mouse click on the button fires normally.
→ Exclusively a mobile/touch attack. Desktop QA misses this entirely.
For a click event to fire from a touch:
1. touchstart fires on the element
2. Browser recognizes a "tap" gesture (minimal movement, < 250ms)
3. Browser fires: touchend, then compatibility: mousedown, mouseup, click
touch-action:none at step 1: browser suppresses gesture recognition.
Result: touchstart fires, but no click is generated.
Workaround available to attackers: supply a touchend handler on the button that
calls e.preventDefault() — this achieves the same result and is harder to detect
because it requires JavaScript analysis, not just CSS inspection.
Detection:
Check getComputedStyle(el).touchAction for consent confirm button.
If touchAction === "none" → HIGH SA-CSS-PTN-004.
Also check touchAction on ancestors: touch-action is inherited for event dispatch
purposes (parent touch-action:none blocks touches on descendants).
Supplementary: test whether a programmatic TouchEvent on the button fires click. */
Mobile-only impact: touch-action:none has no effect on desktop browsers using a mouse. An MCP server deploying this attack knows that desktop security reviewers and automated audits running on desktop environments will find a fully functional consent button. Only a mobile user — or an audit that explicitly simulates touch events — will discover that the button is non-functional. Consent audits must test consent interaction with both mouse events and touch events on mobile-equivalent viewports to detect SA-CSS-PTN-004.
touch-action:none on consent confirm button suppresses browser tap-to-click generation; mobile users cannot tap to confirm consent; desktop mouse clicks unaffected. Detection: getComputedStyle(el).touchAction === "none" on consent confirm button or ancestors → HIGH (mobile accessibility failure and consent bypass).Summary of SA-CSS-PTN findings
| ID | Severity | Pattern | Mechanism | Affected devices |
|---|---|---|---|---|
| SA-CSS-PTN-001 | HIGH | pointer-events:none on dialog container | Entire consent dialog unresponsive to pointer; clicks pass through | Mouse + touch (keyboard unaffected) |
| SA-CSS-PTN-002 | CRITICAL | Invisible overlay button at same position | opacity:0 button with pointer-events:auto captures clicks; different action fires | Mouse + touch |
| SA-CSS-PTN-003 | CRITICAL | Clickjacking — consent Allow button behind overlay | Consent dialog z-index:-1; transparent UI overlay captures or routes clicks to Allow button | Mouse + touch |
| SA-CSS-PTN-004 | HIGH | touch-action:none on confirm button | Tap gesture suppressed; no click generated on mobile; desktop unaffected | Touch/mobile only |