FAQ Module - Search problem

Moderator: crythias

Locked
keitarobr
Znuny newbie
Posts: 16
Joined: 10 Jan 2013, 22:41
Znuny Version: 4.0.3
Real Name: Rodrigo Gonçalves
Company: UFSC

FAQ Module - Search problem

Post by keitarobr »

Dear all,

we've identified the following logs in our OTRS:

Message: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like', SQL: 'SELECT i.id, count( v.item_id ) as votes, avg( v.rate ) as vrate FROM faq_item i LEFT JOIN faq_voting v ON v.item_id = i.id LEFT JOIN faq_state s ON s.id = i.state_id WHERE i.valid_id IN (1) AND s.type_id IN (3) AND LOWER(i.f_keywords) LIKE LOWER('%configuraäÛÎÔÛÜ<U+009D>^P<U+009E>OPØ]^YYÛÜ<U+009E>NÓÜ<U+0099>^Y\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<U+008F>QESCÝÛ<U+008E>ÔÝ^X\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<U+009D>^R^Z]^OL%') AND i.approved = 1 GROUP BY i.id, i.f_subject, i.f_language_id, i.created, i.changed, s.name, v.item_id ORDER BY i.changed DESC, i.id DESC LIMIT 200'


Looks like some robot from a remote IP ( 5.10.83.94 ).

My question is: shouldn't the FAQ work with param binding, to prevent SQL injection? I've looked into the code and it does not use such feature. This is a serious security issue in a web system.
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: FAQ Module - Search problem

Post by jojo »

I can see now issue of a remote SQL injection here. But it seems that your database and/or tables are not utf8.

Also please always tell which OTRS and module version you are using
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Locked