Bug 1016514 - Nitrate is vulnerable to XSS when w3m is not installed
Nitrate is vulnerable to XSS when w3m is not installed
Status: NEW
Product: TCMS
Classification: Other
Component: Application (Show other bugs)
All All
unspecified Severity high
: ---
: ---
Assigned To: Yuguang Wang
Depends On:
  Show dependency treegraph
Reported: 2013-10-08 06:04 EDT by Lukas Vacek
Modified: 2016-05-26 09:12 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Lukas Vacek 2013-10-08 06:04:01 EDT
Input from fields with TinyMCE widget (TestPlan: Summary, TestCase: Breakdown, Setup, Action, Expected Results) is not sanitized and is rendered as is to the clients.

The offending function is:

def html2text(value):
    Pipes given HTML string into the text browser W3M, which renders it.
    Rendered text is grabbed from STDOUT and returned.
        cmd = "w3m -dump -T text/html -O ascii"
        proc = Popen(cmd, shell = True, stdin = PIPE, stdout = PIPE)
        return proc.communicate(str(value))[0]
    except OSError:
        # something bad happened, so just return the input
        return value

An attacker can add an arbitrary javascript to, for example, a TestPlan Summary and the javascript is then executed for everyone viewing the test plan.

Note You need to log in before you can comment on or make changes to this bug.