Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: AntiSamy Liferay 7.0
Hi, I have a security vulnerability about cross site scripting (XSS stored) in the liferay forum portlet (com_liferay_message_boards_web_portlet_MBPortlet).
I've been searching a solution in the web and i've fount the following link in liferay documentation about antiSamy.
https://portal.liferay.dev/docs/7-0/deploy/-/knowledge_base/d/antisamy
I've configured the antiSamy like link said in order to cannot put script tags in the forums fields:
Can I avoid the user use script tags in the creation of new forum thread or new forum category?
The test i've made is tu put <script>alert("xss")</script> in category name and when i open this category, the alert show up.
Kind regards,
Íñigo
I've been searching a solution in the web and i've fount the following link in liferay documentation about antiSamy.
https://portal.liferay.dev/docs/7-0/deploy/-/knowledge_base/d/antisamy
I've configured the antiSamy like link said in order to cannot put script tags in the forums fields:
- Whitelist = *
- Blacklist = com.liferay.message.boards.*
Can I avoid the user use script tags in the creation of new forum thread or new forum category?
The test i've made is tu put <script>alert("xss")</script> in category name and when i open this category, the alert show up.
Kind regards,
Íñigo
Hi,
I couldn't reproduce it on 7.0 GA3. Maybe it's fixed?
Btw. 7.0 is very outdated community version, I strongly recommend to upgrade, there were more serious issues than just XSS, look at https://portal.liferay.dev/learn/security/known-vulnerabilities.
Sincerely,
-- tom +
I couldn't reproduce it on 7.0 GA3. Maybe it's fixed?
Btw. 7.0 is very outdated community version, I strongly recommend to upgrade, there were more serious issues than just XSS, look at https://portal.liferay.dev/learn/security/known-vulnerabilities.
Sincerely,
-- tom +
Sorry Tomas,
I wasn't precise about the version i'm using, is not community, is DXP.
Particulary, is the next version:
I wasn't precise about the version i'm using, is not community, is DXP.
Particulary, is the next version:
- Liferay 7 DXP, build number: 7010
- FixPaxk: 88-7010.
Ah, ok. Have you tried to contact the support? They should help you better, they know your environment and have the bandwith to help you. Thanks!
Hi,
I've found that this problem occurs only wiht my custom theme.
If I set the classic theme of liferay or other custom theme develop by me, the antisamy works properly.
Anyone has any idea of what can have my theme for what the antisamy is not working??
Kind regards,
Iñigo
I've found that this problem occurs only wiht my custom theme.
If I set the classic theme of liferay or other custom theme develop by me, the antisamy works properly.
Anyone has any idea of what can have my theme for what the antisamy is not working??
Kind regards,
Iñigo
Hi,
Finally, the theme was right but the problems was in our ADT to print the breadcrumb. I saw that in the breadcrumb's ADT of liferay, the title was escaped manually and in ours ADT i didn´t do it.
Using the htmlUtil.escape() method when I print the breadcrumbs title , the problem was solved.Now, I have the same vulnerability in our web content custom templates. I thougth that the antisamy property should do this task, but I tried several configurations and none works like i wish.
Have I to escape manually all the custom fileds in all of my custom templates with the method htmlUtil or there is any configuration to escape the values of the fields of my custom templates?
Kind regards,
Iñigo
Finally, the theme was right but the problems was in our ADT to print the breadcrumb. I saw that in the breadcrumb's ADT of liferay, the title was escaped manually and in ours ADT i didn´t do it.
Using the htmlUtil.escape() method when I print the breadcrumbs title , the problem was solved.Now, I have the same vulnerability in our web content custom templates. I thougth that the antisamy property should do this task, but I tried several configurations and none works like i wish.
Have I to escape manually all the custom fileds in all of my custom templates with the method htmlUtil or there is any configuration to escape the values of the fields of my custom templates?
Kind regards,
Iñigo
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™