Loading
Reject userinfo, non-default ports, trailing-dot hosts in <iframe>s
What does this MR do and why?
The BE hardening part of https://gitlab.com/gitlab-org/gitlab/-/work_items/637694+ (staff-only):
- Reject URLs with userinfo, non-default ports, and hosts that end in a full-stop.
- I'm not rejecting any character outside RFC 3986. We don't need it once we stop shipping the raw string, and it unnecessarily excludes Unicode characters as a possibility.
Calling this typefeature and not typebug since it's a still disabled-by-default FF.
Screenshots or screen recordings
Input:
<iframe src="https://example.com\@www.youtube.com/embed/dQw4w9WgXcQ"></iframe>| Before | After |
|---|---|
|
I'm hovering "Open in new tab" with my mouse cursor: note the link destination shown at bottom! |
It's treated like any other embed that doesn't target a valid provider. |
How to set up and validate locally
- Check out
master. - Enable the
allow_iframes_in_markdownFF. - Go to Admin → Settings → General → Embedded content.
- Check "Enable embedded content", "YouTube", and "Figma", then click "Save changes".
- Restart your Caproni cluster/GDK.
- Open a Markdown field (work item/MR description or comment works fine), and try the above reproduction case. Be sure to use the plain-text editor. You should see the Before side.
- Check out this branch.
- Repeat step 6, but add an extra space between
iframeandsrcto not use the earlier cached render. You should see the After side.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Asherah Connor

