Skip to content

csp: allow data: and blob: images so Safari and Firefox can draw - #264

Closed
jseifeddine wants to merge 1 commit into
sol1:mainfrom
jseifeddine:fix/csp-img-src
Closed

jseifeddine wants to merge 1 commit into
sol1:mainfrom
jseifeddine:fix/csp-img-src

Conversation

@jseifeddine

Copy link
Copy Markdown
Contributor

Stacked PR 1 of 18. The series splits #255 into reviewable pieces; each later PR builds on the one before it and says so at the top.

Fixes #249.

Safari and Firefox (no WebCodecs ImageDecoder) draw every Guacamole tile from a data: URI. The Content-Security-Policy had no img-src, so default-src 'self' refused them and SSH/RDP sessions rendered black with only rect fills and the cursor cell showing. Chrome decodes from the stream and never fetches a URL, which hid it. The same gap blocked the remote mouse cursor and blob: images.

  • img-src 'self' data: blob: added; the policy moves into a documented constant.
  • docs/reverse-proxies.md: the proxy-side header replacement for releases up to v1.10.5.

Testing

  • Automated: test_csp_allows_data_and_blob_images fails if either source is dropped.
  • Manual: Safari or Firefox, open an SSH entry, scroll 400 lines: text renders; no securitypolicyviolation with blockedURI: "data" in the console.

The Content-Security-Policy had no img-src, so default-src 'self'
governed images and refused the data: URIs the Guacamole client draws
every tile from on browsers without WebCodecs ImageDecoder. Safari and
Firefox rendered SSH and RDP sessions black with only rect fills and the
cursor cell showing; Chrome decodes straight from the stream and never
fetches a URL, which hid it. The same directive blocks the remote mouse
cursor (cursor: url(data:...)) and blob: image URLs.

Move the policy into a documented constant, add img-src 'self' data:
blob:, and add a unit test that fails if img-src loses either source.
Document the proxy-side header replacement for releases up to v1.10.5.

Fixes sol1#249
@davekempe

Copy link
Copy Markdown
Member

Merged into main as cb425ee, thanks Jad. This one fixed more than Safari and Firefox: the remote pointer from v1.10.2 is a data: image too, so it was being refused in every browser. Verified on our canary, 7 CSP violations per session down to 0. It'll go out in the next release.

@davekempe davekempe closed this Oct 12, 2026
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.

Safari/Firefox: SSH and RDP display renders black or glitchy because CSP has no img-src for data: URIs

2 participants