Kit::ValidateParam fails on passwords containing ampersands

Bug #587947 reported by Micah Tomblin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xibo
Fix Released
Low
Alex Harrington

Bug Description

It appears that we're currently running htmlentities() on _PASSWORD types in Kit::ValidateParam(), which causes passwords containing ampersands to change from something like this: "p&ssword" to something like this: "p&ssword". This can cause the initial database-creation steps of the install to fail.

Related branches

Revision history for this message
Alex Harrington (alexharrington) wrote :

Perhaps need to move to just using sprintf combined with mysql_real_escape_string(). eg: http://www.bitrepository.com/sanitize-data-to-prevent-sql-injection-attacks.html

Presumably $db->escape_string() is equivalent to mysql_real_escape_string() so perhaps all that's required is dropping the htmlentities() command?

I've taken a quick look through the installer/upgrader code and I don't think it would care if that happened.

A

Revision history for this message
Dan Garner (dangarner) wrote : Re: [Bug 587947] Re: Kit::ValidateParam fails on passwords containing ampersands

All strings are sprintf & mysql_real_escape_string before making it into any
SQL - so that wouldn't be necessary.

Perhaps we just drop the html entities?

Revision history for this message
Alex Harrington (alexharrington) wrote :

Sounds sensible. I'll target.

Changed in xibo:
importance: Undecided → Low
status: New → Confirmed
milestone: none → 1.2.0
milestone: 1.2.0 → 1.2.0-rc1
Changed in xibo:
assignee: nobody → Alex Harrington (alexharrington)
Changed in xibo:
status: Confirmed → Fix Committed
Changed in xibo:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.