[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-24 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Hi Dennis,

After our discussion with Dennis, I checked and the pattern ONSITE_URL would be 
 useless without 

.allowAttributes("background").matching(ONSITE_URL)
.onElements("table")
.allowAttributes("background").matching(ONSITE_URL)
.onElements("td", "th", "tr")

So I put them in, in
trunk r1859871
R18 r1859872
R17 r1859873 (too fast, when I hit enter I saw there was not related pending 
changes. I'll have to revert those)
R16 r1859874

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-16 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Hi Dennis,

It's from 2011:
https://github.com/OWASP/java-html-sanitizer/blame/master/src/main/java/org/owasp/html/examples/EbayPolicyExample.java
Not sure why you missed it.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-16 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Actually I checked the changes since Nov 24th (or something like that) and, 
from what I recall, there were no changes in this part. But I could have missed 
something. I think it's safe to add them, even it's not a biggie.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-16 Thread Dennis Balkir (JIRA)


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

Dennis Balkir commented on OFBIZ-10187:
---

Hi Jacques,

you are right, these are missing in my version.

I checked it and it seems, that the ebay version on github was changed on 25th 
march this year, so it might be possible, that the missing components just 
weren't in this file as I used it as a template for my changes.

I didn't add them myself, because I thought, that they are not important enough 
to put them inside of an OFBiz policy opposing to the ones I added, which are 
quite important for current development with HTML 5.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-16 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

To be totally clear I compared the 2 versions. This is what I found:

You added
.allowAttributes("target").matching(NAME).onElements("a")
and the elements "header",  "picture", "source", "section", "nav", "footer"

On the other side there is more:
.allowAttributes("background").matching(ONSITE_URL)
.onElements("table")
.allowAttributes("background").matching(ONSITE_URL)
.onElements("td", "th", "tr")

Are the later missing on purpose?

I was also surprised how slight is 
https://github.com/OWASP/java-html-sanitizer/blob/master/src/main/java/org/owasp/html/examples/SlashdotPolicyExample.java

Anyway I'll try to use that as safe in a 1st step and will reserve eBay one as 
permissive as you did (ie will not change anything from your work).




> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-16 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Thanks Dennis,

Yes it quite helps :)

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-16 Thread Dennis Balkir (JIRA)


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

Dennis Balkir commented on OFBIZ-10187:
---

Hi Jacques,

sorry for my late response, but I thought that you solved this for you after 
you wrote this comment.
{quote}Mmm, finally it's not as deprecated as I thought. Because [I looked at a 
fork|https://github.com/andresriancho/owaspantisamy] when I look at what I 
think it's the original I see it's maintained:
 [https://github.com/nahsra/antisamy]
 [https://github.com/nahsra/antisamy/issues/10]

Still we are actually using [https://github.com/OWASP/java-html-sanitizer] 
which is clearly well maintianed, and turning to antisamy does not seem to be 
better for us.
{quote}
I actuall got this CustomPolicy Class from the github project that you linked 
in one of your first comments:
{quote}I don't remember all about prepackaged policies from the top of my head 
and when looking for references from 
[https://github.com/OWASP/java-html-sanitizer] I got this
{quote}
This is the example class featured in the project: 
[https://github.com/OWASP/java-html-sanitizer/blob/master/src/main/java/org/owasp/html/examples/EbayPolicyExample.java]
 I just added some important things that were missing and were not violateble 
with cross scripting, including some HTML 5 elements, since they were not at 
all featured in this example.

I hope this helps, if there are any more questions, feel free to ask.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-16 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Hi [~mbrohl], [~Dennis Balkir]

Sorry to ask you again:
{quote}While working on OFBIZ-10054, I noticed that I think you somehow 
"translated" an antisamy xml example inspired by eBay to create 
CustomPermissivePolicy.java. Is that right?
 If yes, I believe you did so because the AntiSamy API has not been updated 
since 2013. Is that right too? I ask that because I believe it would be 
interesting to translate also the safer policy inspired by Slashdot and I'd 
like to know your experience, thanks.
{quote}
 

I'd like to know because I want something safer than a policy similar to eBay's 
to use in OFBIZ-5254

Thanks

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-15 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

I reopened OFBIZ-5254 and will handle it there.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-09 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

h3. Sorry for the digressions in both Jiras below. I needed to clear my mind 
and put notes somewhere...

A last note, in OFBIZ-10054 I wrote

{quote}
Actually there are 2 ways used in OFBiz:

# To prevent saving stored XSS scriptings in DB we reject them before. This is 
achieved with UtilCodec.checkStringForHtmlStrictNone(). Most of the possible 
XSS attacks rely on the less-than (<) and greater-than (>) symbols. But as 
shown with the current issue there are other types of possibles attacks.
# Filter HTML texts and remove the unwanted parts. This is done using policies 
with HtmlEncoder::sanitize. The default policy is not much permissive. Since 
OFBIZ-10187 it's easier to create own more permissive policies. An example 
inspired by eBay is available OOTB.. To be safer a policy inspired by Slashdot 
could be used. Anyway it's up to you... I should note here though that 
currently the AntiSamy API is not used in OFBiz. This is something that still 
need to be clarified with the authors of OFBIZ-10187. Maybe it was easier for 
them to adapt from XML to Java...

These 2 ways (reject or filter) are somehow discussed here: 
https://github.com/OWASP/java-html-sanitizer/blob/master/docs/html-validation.md
{quote}

The most interesting part is at the bottom and says

{quote}
One use case for validation seems to be to allow a comment edit window to warn 
about markup that violates a policy instead of dumping a sanitized output on 
them and asking them to look past cosmetic differences like changes in case and 
entity encoding.

Knowing that an input is invalid does not help narrow down the problematic part 
of the input.

This use case seems to be addressable via

String normalizedButNotFiltered = policyThatAllowsEverything.sanitize(input);
String filtered = policy.sanitize(input);
boolean violatedPolicy = !normalizedButNotFiltered.equals(filtered);

and those two can be structurally compared to narrow down the problematic part.
{quote}

I will have nother look at OFBIZ-10054 and decide if we can't use this way. I 
1st wanted to make it works and handling js events in a policy is another story 
for another Jira...



> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA

[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-09 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Mmm, finally it's not as deprecated as I thought. Because [I looked at a 
fork|https://github.com/andresriancho/owaspantisamy] when I look at what I 
think it's the original I see it's maintained:
https://github.com/nahsra/antisamy
https://github.com/nahsra/antisamy/issues/10

Still we are actually using https://github.com/OWASP/java-html-sanitizer which 
is clearly well maintianed, and turning to antisamy does not seem to be better 
for us.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-09 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Hi [~mbrohl], [~Dennis Balkir],

While working on OFBIZ-10054, I noticed that I think you somehow "translated" 
an [antisamy xml example inspired by 
eBay|https://github.com/andresriancho/owaspantisamy/blob/master/Java/antisamy-smoketest/src/main/webapp/WEB-INF/policies/antisamy-ebay.xml]
 to create CustomPermissivePolicy.java. Is that right?

If yes, I believe you did so because the AntiSamy API has not been updated 
since 2013. Is that right too? I ask that because I believe it would be 
interesting to translate also [the safer policy inspired by 
Slashdot|https://github.com/andresriancho/owaspantisamy/blob/master/Java/antisamy-smoketest/src/main/webapp/WEB-INF/policies/antisamy-slashdot.xml]
 and I'd like to know your experience, thanks.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-09 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

By default we now use a permissive sanitizer policy, I updated/fixed 
owasp.properties in
trunk r1858980  
R18 r1858981
R17 r1858982
R16 r1858983


> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-09 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Thanks Mathieu,

I backported r1858933 in R16 at r1858978b to ease further possible backports

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 16.11.06, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-09 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

As I needed the fix for OFBIZ-10054, I backported it using  
[^OFBIZ-10187_Sanitizer_16.11.patch]  in
R16 r1858968

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-08 Thread Mathieu Lirzin (JIRA)


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

Mathieu Lirzin commented on OFBIZ-10187:


I have applied  
[^OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch] :

Committed revision 1858933 on Trunk
Committed revision 1858934 on release18.12
Committed revision 1858935 on release17.12

Thanks Jacques for sharing your opinion.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-05-01 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Hi Mathieu,

I see no reasons to not do so.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 18.12.01
>
> Attachments: 
> OFBIZ-10187_Rewrite-CustomPermissivePolicy-matchesEithe.patch, 
> OFBIZ-10187_Sanitizer.patch, OFBIZ-10187_Sanitizer_16.11.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-04-30 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Thanks Michael,

I tested your R16 patch going to https://localhost:8443/cmssite in debug mode 
and it works properly: +1 for backporting.
Actually the only difference with later is the introduction of Birt Flexible 
Reports after R16.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>  Labels: backport-needed
> Fix For: 17.12.01, 18.12.01
>
> Attachments: OFBIZ-10187_Sanitizer.patch, 
> OFBIZ-10187_Sanitizer_16.11.patch, OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-04-29 Thread Michael Brohl (JIRA)


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

Michael Brohl commented on OFBIZ-10187:
---

This is fixed in

trunk r1858352

release17.12 r1858354

release 18.12 r1858353

 

I'm not sure about backporting to 16.11 and added a valid patch for this.

Devs, please check and give feedback if this should be backported to 16.11 
also, thanks!

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: Trunk, 16.11.04, Release Branch 17.12, Release Branch 
> 18.12
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-04-04 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Hi Guys,

I made a quick review and tests. As ever I got much sidetracked shaving the 
Yak. So I could not make all the tests I wanted. But I thank you guys for this 
work. We seems to have now something really helpful :) +1 to commit!

I'll soon create a Jira to extend this work for stuff like OFBIZ-10054 as 
mentioned above

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-04-02 Thread Michael Brohl (JIRA)


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

Michael Brohl commented on OFBIZ-10187:
---

I think we are good to go with the latest patch.

If there are no objections against this solution, I'm going to commit this at 
the weekend.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-04-02 Thread Dennis Balkir (JIRA)


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

Dennis Balkir commented on OFBIZ-10187:
---

Hi Michael and Jacques,

I added a new patch, which is not that different, but includes a few HTML 5 
specific elements inside of the custom policy.
This will provide at least some HTML 5 compability.

 

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Dennis Balkir
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch, 
> OFBIZ-10187_Sanitizer_New.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-04-01 Thread Dennis Balkir (JIRA)


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

Dennis Balkir commented on OFBIZ-10187:
---

Hi Jacques and Michael,

it has been some time since this patch was provided and I simply wanted to make 
sure, that it won't be forgotten.

Thanks!

 

PS: I didn't mean to assign that issue to me, I just seemed to press a wrong 
button.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Dennis Balkir
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-03-07 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Hi Michael,

Agreed, it should be another Jira based on the work Dennis did here (still to 
be rewieved). 

Because, as I wrote many times, owasp.esapi is flawed and that was the reason 
the sanitizer and policies were created. I'll see that later...

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-03-07 Thread Michael Brohl (JIRA)


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

Michael Brohl commented on OFBIZ-10187:
---

[~jacques.le.roux],

I think we should not mix up things too much. This issue and the patch Dennis 
provided addresses the problem that the sanitizer policy is too restrictive for 
real world projects. It improves the current implementation by adding more 
flexibility for users while still preserving the status quo in the default 
setting.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-03-07 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Thanks Dennis,

I'll have a look ASAP which should not be this weekend but the next, at the 
earliest.

We need to extend policies usage to fix issues like OFBIZ-5254, OFBIZ-10054 and 
at large contiue the work began at OFBIZ-5343 and especially answer to 
discussion like https://markmail.org/message/gdyolxnpl5heu6ru. In other words 
to completely replace owasp.esapi by policies everywhere.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2019-03-07 Thread Dennis Balkir (JIRA)


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

Dennis Balkir commented on OFBIZ-10187:
---

Hi Jacques, Michael,

since this is something I stumbled upon while working on a project, I took my 
time to implement a fix to this.
I added some funtionality and made the whole sanitizing process more 
customizable this way.

This is the way it works:
* There is now a properties {{sanitizer.enable}}, which I added to 
owasp.properties, that can turn on or off the whole sanitizing process
* I changed the existing property {{sanitizer.permissive.policy}} from boolean 
use to text use
* With {{sanitizer.permissive.policy=CUSTOM}} it is now possible to use a 
customized policy, which then replaces the {{PERMISSIVE_POLICY}}
** I implemented an Interface, which is the base for the custom policy
** There is another property {{sanitizer.custom.policy.class}} in which a class 
path can be specified
** The sanitize method will get the class for the path from the property and 
will check if it implements the mentioned interface
** When the class implements the interface, a method {{getSanitizerPolicy()}} 
is used and will return the specified policy of the custom class
** When failing, the default {{PERMISSIVE_POLICY}} is used as a fallback

I also added a class {{CustomPermissivePolicy}} which can be used as an example 
for this customizing process.
There also should be no invulnerable policies in there, so it should be safe to 
use, even without changing it at all.
It also features many attributed and elements that the current 
{{PERMISSIVE_POLICY}} is missing.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
> Attachments: OFBIZ-10187_Sanitizer.patch
>
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-12-26 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux commented on OFBIZ-10187:
-

Good news: we have access again to https://github.com/OWASP/java-html-sanitizer 
and prepackaged policies there.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Michael Brohl
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-31 Thread Michael Brohl (JIRA)

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

Michael Brohl commented on OFBIZ-10187:
---

I think we have to decide on several points:
 * what should be the default setting OOTB?
 * what should be in PERMISSIVE_POLICY?
 * how can we enhance this mechanism to allow better customization without 
changing the OFBiz standard code?

I'm going to test if using the permissive policy allows for a reasonable set of 
html and come back then.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Jacques Le Roux
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-30 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-10187:
-

To summarize, it's a delicate matter. All depend on your context. If people 
allowed to edit your content template can be trusted it's of course easier 
(like allow all). If you open your templates to the Internet that's another 
problem...

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Jacques Le Roux
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-30 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-10187:
-

Div is also referenced from inside owasp.properties: 
https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#DIV
Seems only "STYLE" is an issue.

So if you need to be careful you could base your policy on that. I wonder why 
OWASP did not, but they are like us: an open project with limited resources. So 
it's maybe just that.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Jacques Le Roux
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-30 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-10187:
-

I don't remember all about  prepackaged policies from the top of my head and 
when looking for references from  https://github.com/OWASP/java-html-sanitizer 
I got this
{code}
AccessDeniedAccess 
Denied899F32622D073078j/5bP+ZPinxYl8Fn79QCX7fggMciqgs5d0mcwo19FG593dAZmayAAZY3qOAZ6LxJszlqi/sG5Tw=
{code}
Not sure why I'd need an access, I guess it's an error on their side.

Anyway your problem, as you show it so far, is not related with ul and li but 
only div:
{code}
@@ -1,14 +1,14 @@
-
+   
  
- 
- 
+ 
+ 
  Lorem ipsum dolor sit amet
  At vero eos et accusam et justo
  
  Lorem ipsum dolor sit amet, consetetur sadipscing 
elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
  takimata sanctus est Lorem ipsum dolor sit amet.
  
- weitere Informationen
+ weitere Informationen
  
  
  
{code}
And there is a reason for that, see the "XSS Prevention Rules Summary" section 
here:
https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#Bonus_Rule_.234:_Use_the_X-XSS-Protection_Response_Header

So, as far as I can remember, OOTB I used the simplest recommended way to 
protect things. You may want to bypass it all, if you are sure about the usage, 
or create your on policy. Did you try the PERMISSIVE_POLICY ?


> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Jacques Le Roux
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-30 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-10187:
-

Yes, that's certainly possible, I'll have a look ASAP...

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Assignee: Jacques Le Roux
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-30 Thread Michael Brohl (JIRA)

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

Michael Brohl commented on OFBIZ-10187:
---

I guess that
{code:java}
PolicyFactory sanitizer = 
Sanitizers.FORMATTING.and(Sanitizers.BLOCKS).and(Sanitizers.IMAGES).and(Sanitizers.LINKS).and(Sanitizers.STYLES);{code}
is responsible for this. This statement will be executed every time, 
independend of an activated  PERMISSIVE_POLICY or BIRT_FLEXIBLE_REPORT_POLICY.

It just allows some basic html with basic attributes for links and images, 
that's why the example shows these attributes.

I think this needs some rework to allow everything when there is no policy 
given.

What do you think?

 

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-30 Thread Michael Brohl (JIRA)

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

Michael Brohl commented on OFBIZ-10187:
---

I had to correct the bug description: the permissive policy was not active so 
it is not the cause of the wrong html rendering. There must be something else 
in the sanitizer logic.

I can confirm that
{code:java}
return sanitizer.sanitize(original);{code}
in
{code:java}
UtilCodec.sanitize(String original, String contentTypeId){code}
changes the original content to the stripped version.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Priority: Critical
>
> The current implementation of the sanitizer breaks the proper rendering of 
> html code. In our case, class attributes are stripped from the html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10187) OWASP sanitizer breaks proper rendering of HTML code

2018-01-30 Thread Michael Brohl (JIRA)

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

Michael Brohl commented on OFBIZ-10187:
---

[~jacques.le.roux],

can you explain the idea behind the current PERMISSIVE_POLICY?

I do not understand why rendering is restricted to only html elements "html", 
"body", "div", "center", "span", "table", "td" and why no attributes are 
allowed.

What about "ul", "li" etc., I don't expect these elements to be harmful.

> OWASP sanitizer breaks proper rendering of HTML code
> 
>
> Key: OFBIZ-10187
> URL: https://issues.apache.org/jira/browse/OFBIZ-10187
> Project: OFBiz
>  Issue Type: Bug
>  Components: ALL COMPONENTS
>Affects Versions: 16.11.04
>Reporter: Michael Brohl
>Priority: Critical
>
> The current implementation of the PERMISSIVE_POLICY breaks the proper 
> rendering of html code. In our case, class attributes are stripped from the 
> html content.
> Example:
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> will be rendered to
> {code:java}
>     
>           src="<@ofbizContentUrl>/webcontent/img/slider/1.jpg" 
> alt="" />
>                  
>                      
>                          Lorem ipsum dolor sit amet
>                          At vero eos et accusam et justo
>                          
>                              Lorem ipsum dolor sit amet, consetetur 
> sadipscing elitr, dolores et ea rebum. Stet clita kasd gubergren, no sea
>                              takimata sanctus est Lorem ipsum dolor sit amet.
>                          
>                           href="<@ofbizUrl>cms/~webpage_id=100">weitere Informationen
>                      
>                  
>              {code}
> I do not see any reason to not allow class attributes in html code. There 
> might be other problems with these rules but this is a showstopper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)