restify / restify/node-restify

XSS filter only works in query strings

Open
#1,734 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.7k
Forks
975
Avg merge
1d 6h
Merged PRs (30d)
5

Description

  • Used appropriate template for the issue type
  • Searched both open and closed issues for duplicates of this issue
  • Title adequately and concisely reflects the feature or the bug

Bug Report

Restify Version 4.1.1

Node.js Version 4.9.1

Expected behaviour

xss filter works to clean scripts

Actual behaviour

xss filter only works to clean scripts in query strings

Repro case

use postman to send REST requests, and compare responses

GET https://testhost/xss?<script>alert(73541);</script>

{
"code": "ResourceNotFound",
"message": "/xss does not exist"
}

GET https://testhost/xss/<script>alert(73541);</script>

{
"code": "ResourceNotFound",
"message": "/xss/%3Cscript%3Ealert(73541);%3C/script%3E does not exist"
}

Cause

Insufficient development on previous fixes on #1031 #1032 to #1018

Are you willing and able to fix this?

Yes. I would like to investigate for a sulotion, but I'll be appreciated if someone can have a quickier fix.

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

Reproduce the two GET requests from the issue with Postman and compare how query-string and path parameters are handled. Read the earlier fixes in #1031, #1032, and #1018 to understand the existing XSS filtering path. Done means scripts in both query strings and URL paths are cleaned consistently without changing the expected ResourceNotFound response.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.