[ 
https://issues.apache.org/jira/browse/WW-5623?focusedWorklogId=1021171&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1021171
 ]

ASF GitHub Bot logged work on WW-5623:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/May/26 07:00
            Start Date: 20/May/26 07:00
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1701:
URL: https://github.com/apache/struts/pull/1701#issuecomment-4495495190

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1701) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [13 New 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1701&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1701&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1701&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [100.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1701&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1701&metric=new_duplicated_lines_density&view=list)
  
     
   <!

Issue Time Tracking
-------------------

    Worklog Id:     (was: 1021171)
    Time Spent: 1h 20m  (was: 1h 10m)

> XSS in PostbackResult.doExecute()
> ---------------------------------
>
>                 Key: WW-5623
>                 URL: https://issues.apache.org/jira/browse/WW-5623
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 7.1.1
>            Reporter: Tran Quac
>            Priority: Major
>             Fix For: 6.10.0, 7.2.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> h2. Summary
> PostbackResult.doExecute() at line 107 embeds finalLocation into a form 
> action attribute via raw string concatenation without HTML encoding. The 
> response Content-Type is text/html (line 103). A double-quote character in 
> the location breaks out of the attribute, enabling reflected XSS.
> This is an encoding inconsistency: form field names and values at lines 
> 218-219 ARE properly URL-encoded via URLEncoder.encode(), but the form action 
> attribute was not encoded at all.
> h2. Changes
>  * {*}PostbackResult.java{*}: Add encodeHtml() method to escape &, ", <, > in 
> finalLocation before embedding in the HTML form tag. Consistent with the 
> existing encoding approach for form field values.
> h2. Impact
> When a developer uses PostbackResult with an OGNL expression referencing a 
> user-controllable property (a documented framework feature for dynamic 
> routing), an attacker can inject arbitrary HTML attributes and elements via 
> the form action attribute.
> h2. Refer
> [https://github.com/apache/struts/pull/1653]
> [https://github.com/apache/struts/pull/1653/changes/1b2242487179f38009d118707b8e70ab396a3d27]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to