Skip to main content
Vulnerability Database/CVE-2016-20098

CVE-2016-20098: Reddit Moderator Toolbox XSS Vulnerability

CVE-2016-20098 is a stored XSS flaw in Reddit Moderator Toolbox that lets attackers inject malicious scripts through wiki fields. This post covers technical details, affected versions, impact, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2016-20098 Overview

CVE-2016-20098 is a stored cross-site scripting (XSS) vulnerability in the Reddit Moderator Toolbox browser extension (reddit-moderator-toolbox) before version 4.0.14. The flaw resides in the removalreasons module, which inserts subreddit toolbox wiki fields into popup HTML without encoding. An attacker with permission to edit the toolbox wiki page can plant JavaScript in fields such as pmsubject, header, or reason titles. The injected script executes within the browser session of any moderator who triggers the removal reasons popup, acting with that moderator's authenticated Reddit session.

Critical Impact

Stored JavaScript executes under moderator Reddit sessions, enabling account actions, subreddit configuration changes, and session hijacking against privileged users [CWE-79].

Affected Products

  • Reddit Moderator Toolbox browser extension (reddit-moderator-toolbox) versions prior to 4.0.14
  • The removalreasons module in extension/data/modules/removalreasons.js
  • Subreddits using the toolbox removal reasons wiki configuration

Discovery Timeline

  • 2026-10-09 - CVE-2016-20098 published to NVD
  • 2026-10-09 - Last updated in NVD database

Technical Details for CVE-2016-20098

Vulnerability Analysis

The Reddit Moderator Toolbox is a community-maintained browser extension that augments Reddit's moderation interface. The removalreasons module reads JSON configuration from a subreddit's toolbox wiki page and renders values into a popup used by moderators when removing posts or comments.

Before version 4.0.14, the module passed wiki-supplied strings directly into the HTML popup template. Fields including pmsubject, logreason, header, footer, logsub, logtitle, bantitle, and per-reason title values were inserted without HTML encoding. Any <script> tag or event-handler attribute placed in those fields executed when a moderator opened the popup.

Because the extension runs in the context of reddit.com, injected scripts inherit the moderator's authenticated session cookies and can issue arbitrary API calls on their behalf.

Root Cause

The root cause is missing output encoding on attacker-controlled wiki content. The patch introduces TBUtils.htmlEncode() on every untrusted field prior to insertion into the DOM. The project also notes that stored wiki content is HTML-escaped at rest, but the module previously unescaped values with unescape() and inserted them without re-encoding, defeating the storage-level protection.

Attack Vector

Exploitation requires an attacker with wiki edit permissions on a subreddit (typically a moderator or approved wiki contributor). The attacker edits the toolbox removal reasons wiki page and embeds JavaScript in one of the vulnerable fields. When another moderator triggers the removal reasons popup, the payload executes under their Reddit session, enabling actions such as modifying moderator permissions, posting content, or exfiltrating session data.

javascript
// Security patch in extension/data/modules/removalreasons.js
                if (yes) yes.click();

                // Get PM subject line
-                data.subject = response.pmsubject || 'Your {kind} was removed from /r/{subreddit}';
+                data.subject = TBUtils.htmlEncode(response.pmsubject) || 'Your {kind} was removed from /r/{subreddit}';

                // Add additional data that is found in the wiki JSON.
                // Any HTML needs to me unescaped, because we store it escaped in the wiki.
-                data.logReason = response.logreason || '';
-                data.header = unescape(response.header || '');
-                data.footer = unescape(response.footer || '');
-                data.logSub = response.logsub || '';
-                data.logTitle = response.logtitle || DEFAULT_LOG_TITLE;
-                data.banTitle = response.bantitle || DEFAULT_BAN_TITLE;
+                data.logReason = TBUtils.htmlEncode(response.logreason) || '';
+                data.header = TBUtils.htmlEncode(unescape(response.header)) || '';
+                data.footer = TBUtils.htmlEncode(unescape(response.footer)) || '';
+                data.logSub = TBUtils.htmlEncode(response.logsub) || '';
+                data.logTitle = TBUtils.htmlEncode(response.logtitle) || DEFAULT_LOG_TITLE;
+                data.banTitle = TBUtils.htmlEncode(response.bantitle) || DEFAULT_BAN_TITLE;

                // Loop through the reasons... unescaping each.
                data.reasons = [];
                $(response.reasons).each(function () {
                    data.reasons.push({
                        text: unescape(this.text),
-                        title: this.title,
-                        flairText: this.flairText,
-                        flairCSS: this.flairCSS
+                        title: TBUtils.htmlEncode(this.title),

Source: GitHub Commit 26f45ba

Detection Methods for CVE-2016-20098

Indicators of Compromise

  • Unexpected <script> tags, onerror=, onclick=, or javascript: URIs in a subreddit's toolbox removal reasons wiki page
  • Outbound requests from reddit.com tabs to attacker-controlled domains shortly after a moderator opens a removal reasons popup
  • Unexplained moderator actions (invites, permission changes, posts) correlated with removal-reason activity

Detection Strategies

  • Audit the toolbox/removal_reasons wiki page of each managed subreddit and compare rendered values against the raw JSON for script content
  • Inspect browser extension inventory and flag installations of reddit-moderator-toolbox below version 4.0.14
  • Review Reddit moderator action logs for anomalous activity originating from accounts that recently used removal reasons

Monitoring Recommendations

  • Enforce browser-level content inspection or DLP on Reddit sessions used by moderation staff
  • Monitor endpoint telemetry for script execution and outbound connections originating from browser processes handling reddit.com
  • Track changes to toolbox wiki pages and alert on edits that introduce HTML tags or encoded script payloads

How to Mitigate CVE-2016-20098

Immediate Actions Required

  • Upgrade the Reddit Moderator Toolbox extension to version 4.0.14 or later on every moderator workstation
  • Review and sanitize existing removal_reasons wiki pages for any embedded HTML or JavaScript
  • Restrict wiki edit permissions on moderation configuration pages to trusted moderators only

Patch Information

The fix is implemented in commit 26f45ba21d84cecb92b1a820896ad3bf5254376e of the toolbox-team/reddit-moderator-toolbox repository. The patch wraps every wiki-sourced string with TBUtils.htmlEncode() before inserting it into the removal reasons popup. See the VulnCheck Advisory on XSS and the upstream Reddit Moderator Toolbox repository for release details.

Workarounds

  • Temporarily disable the Moderator Toolbox extension until all moderators are upgraded to 4.0.14 or later
  • Remove the toolbox/removal_reasons wiki page or revert it to a known-good revision
  • Limit wiki edit permissions to a small set of trusted moderators and require review of configuration changes
bash
# Verify installed extension version in Chromium-based browsers
ls "$HOME/.config/google-chrome/Default/Extensions/" | grep -i toolbox
cat "$HOME/.config/google-chrome/Default/Extensions/<extension-id>/<version>/manifest.json" | grep version

# Required version: 4.0.14 or later

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.