user7491136
user7491136

Reputation:

Where add x-frame-options :sameorigin , in JSP , JAVA,WEB.xml , where?

There is white hat vulnerability in our project is they have provided solution add x-frame-options :sameorigin to block extra frame

but where i should add this code.

Framework - Struts1.1 ApplicationServer- Weblogic12C

Totally confused where to add this particular code please help

Upvotes: 1

Views: 7468

Answers (2)

user7491136
user7491136

Reputation:

I have solve this problem by adding filter in our code :

  1. web.xml

    • filter code mapping and all
  2. Add Filter java class in your project

please find filter class at below link :

https://www.programcreek.com/java-api-examples/index.php?source_dir=JavaSecurity-master/security-header/src/main/java/de/dominikschadow/javasecurity/header/filter/XFrameOptionsFilter.java#

This will add X-Frame-Options in response header

Upvotes: 0

Panagiotis Chavariotis
Panagiotis Chavariotis

Reputation: 976

Oracle Weblogic Server does not have an option for this. In other words, Oracle WebLogic Server (WLS) does not have a setting to control the X-Frame-Options Header. If it's not possible to control this header at an application level, you may configure as follows in the httpd.conf of the Oracle HTTP Server (OHS):

Header always append X-Frame-Options SAMEORIGIN

Upvotes: 2

Related Questions