Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8767231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:45:27+00:00 2026-06-13T16:45:27+00:00

This is my filer config in web.xml <filter> <filter-name>CSRFPreventionFilter</filter-name> <filter-class>org.apache.catalina.filters.CsrfPreventionFilter</filter-class> <init-param> <param-name>entryPoints</param-name> <param-value>/login<param-value> </init-param>

  • 0

This is my filer config in web.xml

<filter>
    <filter-name>CSRFPreventionFilter</filter-name>
    <filter-class>org.apache.catalina.filters.CsrfPreventionFilter</filter-class>
    <init-param>
        <param-name>entryPoints</param-name>
        <param-value>/login<param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>CSRFPreventionFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter>

Am I missing something? Are any code-changes necessary to enable csrf protection in tomcat

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:45:28+00:00Added an answer on June 13, 2026 at 4:45 pm

    Note that a 403 is the CSRFPreventionFilter response if a nonce is not provided and the filter expects one.

    I don’t know the current state of CSRFPreventionFilter, but according to this thread you need to specify each entryPoint resource individually (no wildcards) – or have the filter apply to a path that does not include /login

    So:

    <filter>
    <filter-name>CSRFPreventionFilter</filter-name>
    <filter-class>org.apache.catalina.filters.CsrfPreventionFilter</filter-class>
    <init-param>
        <param-name>entryPoints</param-name>
        <param-value>/login/login.html,/login/image.png,/login/style.css</param-value>
    </init-param>
    </filter>
    

    Or:

    <filter-mapping>
    <filter-name>CSRFPreventionFilter</filter-name>
    <url-pattern>/csrf/*</url-pattern>
    </filter-mapping>
    

    Update Dec 2012:

    Tomcat 7.0.32 fixes a security vulnerability in CSRFPreventionFilter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my config in web.xml file <listener> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter>
I've added some parameters in my web.xml config file, as follow: <context-param> <param-name>service1</param-name> <param-value>http://www.example.com/example2.html</param-value>
This is my web.config file contents: <?xml version=1.0?> <configuration> <system.webServer> <httpErrors errorMode=Detailed /> <asp
I have a filter and parameters in web.xml web.xml is like this: <filter> <description>
In my application's web.xml I originally had Jersey configured as follows: <servlet> <servlet-name>jersey-servlet</servlet-name> <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
Hi there, I have created a Filter class and configure the web.xml as below:
I have this variable defined in my web.config file : <appSettings> <add key =version
Please refer to this post. I have become able to configure my web.config file
Looking in the android sdk folders, I've found a file called values/config.xml . This
I create this filter : public class LoginFilter implements Filter { @Override public void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.