Donate Share

Owl Intranet Knowledgebase

Tracker: Bugs

5 \ are interpreted in input for files - ID: 2864125
Last Update: Settings changed ( b0zz )

When I upload a file with :
title : and\or
description : this is a test for ever\never.
Here is the result :
title : andor
description : this is a test for ever<br />ever

I think it is not only a problem for having an \ in a title or a
description but it is possibly a bad escaping for quote.
I think this code create a problem :
$title = stripslashes($title);
$title = fOwl_ereg_replace("'", "\\'" , fOwl_ereg_replace("[<>]", "",
$title));

stripslahes unescaped the characters single quote ('), double quote ("),
backslash (\) and NUL (the NULL byte).
But fOwl_ereg_replace escape only single quote (').
I think it is necessary to replace fOwl_ereg_replace by a php function
pg_escape_string() or mysqli_real_escape_string() or addslashes.


Julien HEYMAN ( jheyman ) - 2009-09-22 09:08

5

Closed

Fixed

Steve

None

None

Public


Comments ( 3 )

Date: 2009-11-02 19:53
Sender: b0zzProject Admin

Fixed and committed to CVS:

Checking in dbmodify.php;
/cvsroot/owl/owl-0.90/dbmodify.php,v <-- dbmodify.php
new revision: 1.98; previous revision: 1.97
done



Date: 2009-11-02 09:59
Sender: jheyman

I send you the patch to fix it

Cheers


Date: 2009-09-22 13:35
Sender: jheyman

If you create a new note, with keywords = \',(select 1),6,(select
current_date) ,0,1,0,0,1,1);delete from files;--
and title = a
and empty description
and empty note content, you lost all files in owl.


Attached File ( 1 )

Filename Description Download
0001-corrections-des-antislashes-addslashes.patch Download

Changes ( 8 )

Field Old Value Date By
summary \ are interpreted in input for files - ID: 2864125 2009-11-02 19:54 b0zz
status_id Open 2009-11-02 19:53 b0zz
resolution_id None 2009-11-02 19:53 b0zz
assigned_to nobody 2009-11-02 19:53 b0zz
allow_comments 1 2009-11-02 19:53 b0zz
close_date - 2009-11-02 19:53 b0zz
summary \ are interpreted in input for files 2009-11-02 19:53 b0zz
File Added 349162: 0001-corrections-des-antislashes-addslashes.patch 2009-11-02 09:59 jheyman