Skip to content

FIX: Contain and rehost bbcode CSS injection - #163

Merged
Alteras1 merged 2 commits into
mainfrom
fix/css-containment
Sep 19, 2026
Merged

Alteras1 merged 2 commits into
mainfrom
fix/css-containment

Conversation

@Alteras1

Copy link
Copy Markdown
Collaborator

Previously, CSS injected via [bg]/[class]/raw style="" attributes could escape the post to cover the viewport with position: fixed elements, and url() values could point at arbitrary external hosts, so viewing a post silently issued a request to that host on every page load.

This change makes .cooked/.d-editor-preview a containing block via contain: layout and clips overflow with clip-path, and extends core's HotlinkedMedia/PostHotlinkedMedia pipeline (via a plugin-local prepend, no core changes) to rehost CSS url() references the same way core already rehosts <img>/<a> uploads.

This change extends core's `HotlinkedMedia`/`PostHotlinkedMedia` pipeline (via a plugin-local prepend, no core changes) to also discover and download CSS `url()` references, rewrites both `post.cooked` and `post.raw` to point at the resulting local upload the same way core does for images, and resolves leftover `upload://` references client-side so the composer preview renders correctly too.
@Alteras1
Alteras1 merged commit d14af3c into main Sep 19, 2026
3 checks passed
@Alteras1
Alteras1 deleted the fix/css-containment branch September 19, 2026 00:22
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.

1 participant