Skip to content

Render exercise text via textContent, not innerHTML - #61

Open
thejesh23 wants to merge 1 commit into
hasaneyldrm:mainfrom
thejesh23:fix/xss-innerhtml
Open

Render exercise text via textContent, not innerHTML#61
thejesh23 wants to merge 1 commit into
hasaneyldrm:mainfrom
thejesh23:fix/xss-innerhtml

Conversation

@thejesh23

Copy link
Copy Markdown

Instruction steps, meta chip values, and active filter badges were built with template-string innerHTML, so any exercise-derived string containing HTML (or an & / < / >) would be parsed as markup — an injection surface today, a rendering bug even for benign inputs. Replaced each with textContent-based DOM construction (the same pattern already used for card-name, muscle-tag, etc.).

Closes #60

Instruction steps, meta chip values, and active filter badges built
their DOM with template-string innerHTML, so any exercise-derived
string containing HTML would be parsed as markup. Build the nodes and
set text via textContent instead.

Closes hasaneyldrm#60
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.

Exercise browser injects unescaped exercise text via innerHTML

1 participant