mdn / mdn/fred

Content can escape out of CSS & script

Open
#800 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
233
Forks
61
Avg merge
1d 1h
Merged PRs (30d)
82

Description

What information was incorrect, unhelpful, or incomplete?

https://developer.mozilla.org/en-US/play?id=26rQIubfm5xDKlFLwKabujBoPcwBAKCRuBFSHwRl84VYe%2F0OK8GPv%2BSt4QVF1CsohI0M1lgoVOh4lctj

I didn't expect </style>/</script> to escape me out of the expected content.

What did you expect to see?

I expected to remain in CSS/script, as I would if I was editing external files.

Although codepen does this too, so maybe it isn't a big deal.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

I encountered this when using </script> within a string in some script.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked MDN Playground reproduction first and compare its CSS and script handling with editing equivalent external files. Trace the frontend path responsible for embedding or parsing that content, then verify that literal closing tags in CSS or script remain within the expected context without breaking the surrounding document.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.