Conversation
Sanitize post title with escapeHTML() before inserting into innerHTML to prevent script injection via crafted post titles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
2 issues found across 3 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="XMOJ.user.js">
<violation number="1" location="XMOJ.user.js:3">
P2: Manual version bump in the userscript header conflicts with the repository’s automated version management (UpdateVersion workflow). This should be left to the automation to keep XMOJ.user.js, package.json, and Update.json in sync.</violation>
</file>
<file name="package.json">
<violation number="1" location="package.json:3">
P2: Do not manually bump the package.json version. Version updates are automated by UpdateVersion.js and should not be edited in PRs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| // ==UserScript== | ||
| // @name XMOJ | ||
| // @version 3.1.0 | ||
| // @version 3.1.1 |
There was a problem hiding this comment.
P2: Manual version bump in the userscript header conflicts with the repository’s automated version management (UpdateVersion workflow). This should be left to the automation to keep XMOJ.user.js, package.json, and Update.json in sync.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At XMOJ.user.js, line 3:
<comment>Manual version bump in the userscript header conflicts with the repository’s automated version management (UpdateVersion workflow). This should be left to the automation to keep XMOJ.user.js, package.json, and Update.json in sync.</comment>
<file context>
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
-// @version 3.1.0
+// @version 3.1.1
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
</file context>
| { | ||
| "name": "xmoj-script", | ||
| "version": "3.1.0", | ||
| "version": "3.1.1", |
There was a problem hiding this comment.
P2: Do not manually bump the package.json version. Version updates are automated by UpdateVersion.js and should not be edited in PRs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 3:
<comment>Do not manually bump the package.json version. Version updates are automated by UpdateVersion.js and should not be edited in PRs.</comment>
<file context>
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
- "version": "3.1.0",
+ "version": "3.1.1",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
</file context>
This was referenced Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR aim to accomplish?:
Fix a stored XSS vulnerability where unsanitized post titles are inserted via
innerHTML, allowing arbitrary script execution (e.g.,<img src=x onerror=alert('test')>).How does this PR accomplish the above?:
Wrap
ResponseData.Data.Titlewith the existingescapeHTML()function before inserting intoPostTitle.innerHTML. This escapes<,>,",', and&so HTML tags in titles are rendered as text rather than parsed as DOM elements.By submitting this pull request, I confirm the following:
git rebase)