Comments (11)
Hi,
your hdiv-config.xml file is not correctly formatted. You can't have more tan one <hdiv:config>
element in the same file.
Please have a look at this example application and configuration file:
- https://github.com/hdiv/hdiv-struts-examples
- https://github.com/hdiv/hdiv-struts-examples/blob/master/src/main/webapp/WEB-INF/hdiv-config.xml
from hdiv.
Hi
I updated my config file now. I encounter the same error still.. Can kindly help to say where I am going wrong ?
<Jul 7, 2017 11:24:18 PM SGT> <Notice> <Stdout> <BEA-000000> <[DEBUG][2017-07-07 23:24:18,437][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kern el.Default (self-tuning)'][][](org.hdiv.filter.ValidatorHelperRequest) - Error restoring the state: Valid: false, Errorcode: ValidatorError [type=HDI V_PARAMETER_DOES_NOT_EXIST, target=/abc/index.do, parameterName=_HDIV_STATE_, parameterValue=null, originalParameterValue=null, localIp=null, remoteI p=null, userName=null, validationRuleName=null]> <Jul 7, 2017 11:24:18 PM SGT> <Notice> <Stdout> <BEA-000000> <[INFO ][2017-07-07 23:24:18,437][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kern el.Default (self-tuning)'][][](org.hdiv.logs.Logger) - HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/index.do;_HDIV_STATE_;;;127.0.0.1;127.0.0.1;anonymous;>
update:
after adding the startpages as /abc/index.do, I can load my application page. But for each ".do" page I am getting similar error as mentioned above, which leads to HDIV unauthorized error page.
from hdiv.
Ok, we need some clarifications on this. You should set as StartPage every single page that can be accessed directly, usually / but there may be others. For the rest of them
you should be navigating using the links provided by the application. In those links if Hdiv integration is correct you should be seeing something like this:
/efm/whatever.do?HDIV_STATE=1-3-AABBCC..
I guess that your current problem is that no link is being generated with that parameter right?. If not please could you explain your situation?
from hdiv.
Thanks for the response.
/efm/whatever.do?HDIV_STATE=1-3-AABBCC..
=> I don't see anything like this in my console and also in my logs.
all I see is as below with no random ID as you mentioned above.
HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/.do;HDIV_STATE;;;127.0.0.1;127.0.0.1;anonymous;>
My application's each menu link or buttons is initiated by a .do. so how do I config this ? looks like I need to all do. as start page which is not the correct way to implement. right ?
My application using struts 1.2.9.
The tld files are taken from the hdiv-master\hdiv-struts-1\target\classes\META-INF\ and I replaced it in my application tld file location /WEB-INF/tld/ and mapped it correctly in the web.xml file.
from hdiv.
Hi,
you should see this kind of url in the HTML of your application: /efm/whatever.do?HDIV_STATE=1-3-AABBCC..
If Hdiv is configured correctly all links and forms contain an HDIV_STATE parameter in links and an extra hidden field in forms.
An important aspect to take into consideration is that you have to create the links and form using Struts tags.
Por example, <html:link>
for links and <html:form>
for forms.
This is the way Hdiv adds the HDIV_STATE parameter automatically.
Are you creating the links and forms using these tags?
from hdiv.
Thanks for your reply
Yes, all the forms are using html:form struts tag. But still the HDIV parameter token is not generated. I am not sure where I am going wrong. I am still figuring it out !
from hdiv.
Ok, the forms are created using Struts tags, and what about the links? Are they created using <html:link>
tags?
from hdiv.
My application do not have html:links tags. All of the actions are triggered by context path .do file.
Struts token are inserted automatically as a hidden field in all JSP if I use saveToken() whereas I face issue with the token to be inserted with HDIV. jar
from hdiv.
Ok, if you are interested in link protection you have to use <html:link>
tag. Otherwise you will get HDIV_PARAMETER_DOES_NOT_EXIST error.
If you are not interested in link protection you have to exclude GET request protection.
Add this line inside <hdiv:config>
tag in the hdiv-config.xml file:
<hdiv:startPages method="get">/.*</hdiv:startPages>
Including this config you will skip the protection of all requests that use method GET.
POST request protection is still enabled with this configuration.
Another important question, which Hdiv version are you using?
We recommend to use last stable version 3.3.0, which is compatible with Struts 1.3.8
from hdiv.
ok, after I change the start pages as suggested above. I get the below error
org.hdiv.filter.ResponseWrapper) - New ResponseWrapper instance. [DEBUG][2017-07-19 10:46:00,630][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.session.SessionHDIV) - Getting page with id:00000000-0000-0000-0000-000000000018 [DEBUG][2017-07-19 10:46:00,630][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.filter.ValidatorHelperRequest) - Validation Error Detected: Parameter [org.apache.struts.taglib.html.TOKEN] does not exist in the state for action [/def/home.do] [INFO ][2017-07-19 10:46:00,630][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.logs.Logger) - INVALID_PARAMETER_NAME;/abc/def/home.do;org.apache.struts.taglib.html.TOKEN;;;192.168.91.1;192.168.91.1;anonymous;
I use the version 3.3.2.
ok. to use the 3.3.0 I download the codes for hdiv-config and hdiv-struts-1 from this link and compile it as a jar file https://github.com/hdiv/hdiv. is this the correct link ?
update:
after I include the below in hdiv config file
<hdiv:startParameters>org.apache.struts.action.TOKEN,org.apache.struts.taglib.html.TOKEN</hdiv:startParam
I get the same error as before
org.hdiv.filter.ResponseWrapper) - New ResponseWrapper instance. [DEBUG][2017-07-19 11:03:56,686][][[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.filter.ValidatorHelperRequest) - Error restoring the state: Valid: false, Errorcode: ValidatorError [type=HDIV_PARAMETER_DOES_NOT_EXIST, target=/def/ghiIndex.do, parameterName=_HDIV_STATE_, parameterValue=null, originalParameterValue=null, localIp=null, remoteIp=null, userName=null, validationRuleName=null] [INFO ][2017-07-19 11:03:56,686][][[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.logs.Logger) - HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/ghiIndex.do;_HDIV_STATE_;;;192.168.91.1;192.168.91.1;anonymous;
I can load my login page, I choose the role to login and click submit, I get the error as above.. (post action)
from hdiv.
Hi,
Hdiv 3.3.0 jars are publicly available at the central Maven repository.
You can download them from this web too: http://search.maven.org/#artifactdetails%7Corg.hdiv%7Chdiv-core%7C3.3.0%7Cjar
It seems Hdiv Taglibs are not executing and the application is invoking Struts original tags instead.
You can check it adding a breakpoint at this method:
org.hdiv.taglib.html.FormTagHDIV.addHDIVParameter()
If should stop every time a form is rendered. If it is not invoked, the Tld is not correctly configured.
To check if the Hdiv taglib installation is correct, review this points:
-
Web.xml file. It must contain a reference to the new tld files.
For example:
https://github.com/hdiv/hdiv-struts-examples/blob/master/src/main/webapp/WEB-INF/web.xml#L122 -
Jsp pages. The
<taglib-uri>
attribute in the web.xml file and the taglib url must be the same:
https://github.com/hdiv/hdiv-struts-examples/blob/master/src/main/webapp/attacks/SQLInjection/SQLStringInjection.jsp#L3 -
Force JSP recompilation, to be sure they are compiled using the new Tld.
https://stackoverflow.com/questions/4626672/how-do-you-force-jsp-to-get-re-compiled
from hdiv.
Related Issues (20)
- File Upload question
- no produce a _HVID_STATE_ HOT 2
- JSTL issue related to hdiv on Jboss7.1
- Error creating bean with name 'requestDataValueProcessor'
- In jsp page I have a list which have an Enum filed in it's object and only first index has the Enum value HOT 1
- Hi, i use ":hdiv:1.0-RC2" version after updating to grails 2.5.6 it doesn't call any pages.
- Dependency org.springframework.security:spring-security-web, leading to CVE problem HOT 1
- Access Control Bypass Vulnerability when forwarding or including via RequestDispatcher
- HDIV is giving INVALID cookie when a page is opening with an image HOT 1
- Restricting the validation to a set of URL HOT 7
- HDIV 3.0.0 execution strategies HOT 2
- HDIV Schema Locations have disappeared from your website? HOT 3
- Getting cannot call getWriter() after getOutputStream error probably because of HDIV validation HOT 2
- HDIV 3.2.0 error INVALID_COOKIE when domain is set HOT 1
- JSTL issue on Wildfly 11 / JBoss EAP 7.1 HOT 3
- Spring+Thymeleaf+Jquery+HDIV HOT 4
- url exclusion not working with spring boot HOT 2
- missing HDIV state hidden param in spring 4.3.13 form HOT 2
- Which spring mvc version does hdiv support?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hdiv.