Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 6.0.12 EE, 6.1.0 CE RC1, 6.1.0 CE GA1, 6.1.10 EE GA1, 6.2.0 CE M2
-
Fix Version/s: 6.1.10 EE GA1, 6.1.20 EE GA2, 6.0.X EE, --Sprint 11/12, 6.2.0 CE M2
-
Component/s: Operations, Operations > Caching > Replication Hook
-
Labels:
-
Branch Version/s:6.1.x, 6.0.x
-
Backported to Branch:Committed
-
Caused by:Feature/improvement was not complete
-
Where was the bug?:Java
-
Added to Fix Pack:Added
-
Similar Issues:
Description
The StripFilter maintains a cache for inlined javascript code and inlined css rules. The idea is to minify the code only once. The key of the cache ist calculated by simply using the hashCode method on the input string. This usage of the hashCode function is wrong, because no collision detection is possible.
Two totally different string values may have the same hashCode. This will result in a situation where the first value is replaced by the second one. If later the minified version of the first string is to be taken from the cache, the second value is retrieved.
There are even some algorithms to generate a string that for a given hash code value (see for example http://java-bytes.blogspot.com/2009/10/hashcode-of-string-in-java.html).
This bug is a very nasty one, because almost always things are running good. But in very rare situations the cache returns the wrong value. The following test code show an example:
assertEquals("HashCode values must not be used as keys".hashCode(), "I<EZH@$YJVK[".hashCode());
As workaround you can disable the minifying of inlined javascript and css code by setting the property minifier.inline.content.cache.size to 0.
Activity
| Field | Original Value | New Value |
|---|---|---|
| Assignee | SE Support [ support-lep@liferay.com ] | Zsolt Balogh [ zsolt.balogh ] |
| Workflow | Liferay Workflow 2.2 [ 259541 ] | LPS Workflow [ 264367 ] |
| Status | Open [ 1 ] | In Progress [ 3 ] |
| Fix Version/s | 6.0.13 EE [ 10764 ] | |
| Fix Version/s | 6.1.11 EE GA2 [ 11519 ] | |
| Fix Version/s | 6.2.X [ 11316 ] |
| Status | In Progress [ 3 ] | In Review [ 10006 ] |
| Git Pull Request | https://github.com/matethurzo/liferay-portal/pull/98 | |
| Assignee | Zsolt Balogh [ zsolt.balogh ] | Mate Thurzo [ mate.thurzo ] |
| Where was the bug? | Java [ 10241 ] | |
| Caused by | Feature/improvement was not complete [ 10212 ] |
| Status | In Review [ 10006 ] | In Review [ 10006 ] |
| Git Pull Request | https://github.com/matethurzo/liferay-portal/pull/98 | https://github.com/sergiogonzalez/liferay-portal/pull/156 |
| Assignee | Mate Thurzo [ mate.thurzo ] | Sergio Gonzalez [ sergio.gonzalez ] |
| Peer Reviewer Name | Mate Thurzo | |
| Peer Review | Passed [ 10235 ] |
| Fix Version/s | 6.0.13 EE [ 10764 ] | |
| Backport Version/s | 6.1.x [ 10511 ] | |
| Backport Committed | Committed [ 10048 ] | |
| Affects Version/s | 6.1.10 EE GA1 [ 11325 ] | |
| Affects Version/s | 6.1.0 CE GA1 [ 10910 ] |
| Status | In Review [ 10006 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| Link | This issue relates LPE-6430 [ LPE-6430 ] |
| Issue Type | Bug [ 1 ] | Technical Support [ 6 ] |
| Labels | QA-C |
| Fix Version/s | --Sprint 3/12 [ 11315 ] | |
| Affects Version/s | 6.2.X [ 11316 ] |
| Fix Version/s | 6.0.13 EE [ 10764 ] | |
| Branch Version/s | 6.1.x [ 10511 ] | 6.0.x,6.1.x [ 10151,10511 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] | |
| Status | Closed [ 6 ] | Reopened [ 4 ] |
| Fix Version/s | 6.1.10 EE GA1 [ 11325 ] |
| Status | Reopened [ 4 ] | Closed [ 6 ] |
| Added to Fix Pack | Added [ 10710 ] | |
| Resolution | Fixed [ 1 ] |
| Issue Type | Technical Support [ 6 ] | Bug [ 1 ] |
| Workflow | LPS Workflow [ 264367 ] | Copy of LPS Workflow [ 428309 ] |
| Workflow | Copy of LPS Workflow [ 428309 ] | LPS Workflow [ 459918 ] |
| Component/s | Operations [ 14582 ] |
| Workflow | LPS Workflow [ 459918 ] | Copy 2 of LPS Workflow [ 492286 ] |
| Workflow | Copy 2 of LPS Workflow [ 492286 ] | LPS Workflow [ 524172 ] |
| Workflow | LPS Workflow [ 524172 ] | PUBLIC - LPS Generic Workflow [ 576067 ] |
| Workflow | PUBLIC - LPS Generic Workflow [ 576067 ] | Copy of PUBLIC - LPS Generic Workflow [ 610376 ] |
| Workflow | Copy of PUBLIC - LPS Generic Workflow [ 610376 ] | PUBLIC - LPS Generic Workflow [ 642305 ] |
