Closed Bug 1563127 Opened 5 years ago Closed 5 years ago

Strings (and potentially whole page) fail to render due to invalid JSON from highlights title with quotes

Categories

(Firefox :: New Tab Page, defect, P1)

defect

Tracking

()

VERIFIED FIXED
Firefox 69
Iteration:
69.4 - Jun 24 - Jul 7
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- unaffected
firefox68 --- unaffected
firefox69 --- verified

People

(Reporter: Mardak, Assigned: jcarlos)

References

(Regression)

Details

(Keywords: github-merged, regression)

Attachments

(1 file)

The JSON for data-l10n-args created manually is incorrect:

<button aria-haspopup="true" data-l10n-id="newtab-menu-content-tooltip" data-l10n-args="{ &quot;title&quot;: &quot;Resolving Error: &quot;Objects are not valid as a React child&quot;&quot; }" class="context-menu-button icon"></button>

Here's the js string value:

{ "title": "Resolving Error: "Objects are not valid as a React child"" }

This particular string injection came from

data-l10n-args={`{ "title": "${title}" }`}

https://github.com/mozilla/activity-stream/blob/1effc63a887147b3ef374945c05b830abbb60a1b/content-src/components/Card/Card.jsx#L249

We should make sure we don't allow string injection and make sure to just call stringify. And fix up all places where we do something similar.

See Also: → 1563128
Blocks: 1563243

This can be tested by creating a bookmark with double quotes in the title

Status: NEW → RESOLVED
Iteration: --- → 69.4 - Jun 24 - Jul 7
Closed: 5 years ago
Keywords: github-merged
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69

I have verified that this issue is no longer reproducible with the latest Firefox Nightly (69.0a1 Build ID - 20190705064618) installed, on Windows 10 x64, Arch Linux and Mac 10.14.5. Now, the strings from the bookmarks highlights that are containing double quotes in the title are successfully rendered.

Status: RESOLVED → VERIFIED
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: