You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacopo Cappellato (JIRA)" <ji...@apache.org> on 2015/02/12 17:31:13 UTC

[jira] [Commented] (OFBIZ-5910) WidgetWorker.buildHyperlinkUrl generates invalid url when using certain sequences of characters

    [ https://issues.apache.org/jira/browse/OFBIZ-5910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14318500#comment-14318500 ] 

Jacopo Cappellato commented on OFBIZ-5910:
------------------------------------------

Thank you [~gareth.carter]! This analysis is also interesting:
http://security.coverity.com/blog/2013/Nov/to-escape-or-not-to-escape-that-is-the-question.html

> WidgetWorker.buildHyperlinkUrl generates invalid url when using certain sequences of characters
> -----------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5910
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5910
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Gareth Carter
>            Assignee: Jacques Le Roux
>         Attachments: WidgetWorker.patch
>
>
> If you define a url with parameters or contains url encoded parameters, the output from WidgetWorker.buildHyperlinkUrl may be invalid. This is because of using StringUtil.defaultWebEncoder.canonicalize(localRequestName).
> eg
> abc=&amp;or1=123    ->   abc=?1=123
> abc=&amp;to1=123    ->   abc=&to1=123 (this one is fine)
> abc=&amp;and1=123    ->    abc=?1=123
> abc=&amp;gtabc=123   ->    abc=>abc=123
> The owasp HTMLEntityCodec seems to look for special sequences (or, and, gt, lt etc) and change them. This to me is invalid because url encoding and html encoding are different
> Why are the urls encoding the ampersands anyway? (String localRequestName = UtilHttp.encodeAmpersands(target);). 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)