問題
- LiferayでCSRF攻撃を防ぐためにCSRFトークンを有効にする方法は?
Environment
- Liferay DXP 7.2
解決策
-
Liferay の p_auth トークン CSRF から保護し、デフォルトで有効になっています。 CSRF トークンを処理するメイン コードは とおりです。 .java
##
## Authentication Token
##
#
# Set this to false to disable CSRF protection in the portal. Disabling
# CSRF protection is not recommended since all features become vulnerable
# to CSRF attacks.
#
# The checks can be disabled for specific actions via the property
# "auth.token.ignore.actions" or for specific portlets via the init
# parameter "check-auth-token" in portlet.xml.
#
# Env: LIFERAY_AUTH_PERIOD_TOKEN_PERIOD_CHECK_PERIOD_ENABLED
#
auth.token.check.enabled=true