Project

General

Profile

Actions

Bug #5459

closed

system_advanced_sysctl.php lacking input validation, output sanitation

Added by Anonymous about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Target version:
Start date:
11/16/2015
Due date:
% Done:

0%

Estimated time:

Description

system_advanced_sysctl.php has no input validation (in 2.2.x either). We should be safe to limit Tunable and Value fields to alphanumeric plus - . and _

Tunable and Value should both be required fields. No restrictions on description necessary.

It's also XSS-able, where 2.2.x isn't. For instance, throw

'><script>alert("hi");</script>

into any of the fields.

Actions #1

Updated by Anonymous about 9 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Anonymous to Chris Buechler

Inputs validated
Error messages provided
htmlspecialchars() protection added where required

Actions #2

Updated by Chris Buechler about 9 years ago

  • Status changed from Feedback to Confirmed
  • Assignee changed from Chris Buechler to Anonymous
  • Priority changed from High to Normal

The XSS is fixed, thanks! It's a bit overzealous on the htmlentities somewhere it appears. For instance, save the

'><script>alert("hi");</script>

as your description, and your config ends up with:
 <descr><![CDATA['&amp;gt;&amp;lt;script&amp;gt;alert(&am
p;quot;hi&amp;quot;);&amp;lt;/script&amp;gt;]]></descr> 

Then you get exactly that upon editing the entry. That'll mess up a variety of usable descriptions.

Actions #3

Updated by Anonymous about 9 years ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Anonymous to Chris Buechler

Kinder, gentler version now saves: "'>alert("hi");" by using strip_tags rather than htmlspecialchars

Actions #4

Updated by Chris Buechler about 9 years ago

  • Status changed from Feedback to Resolved

looks good, thanks!

Actions

Also available in: Atom PDF