Task #11406

Support #11289: [SCP ID :##5584##] : PCI DSS: Web and Mobile SAP Remediation

Pentest_Web_CDB (H1) - Cross-site scripting (stored & reflected DOM-based)

Added by Nurul Athira Abdul Rahim almost 4 years ago. Updated about 3 years ago.

Status:Work Completed-End life cycleStart date:December 01, 2020
Priority:HighDue date:December 03, 2020
Assignee:Nurul Athira Abdul Rahim% Done:

100%

Category:PentestSpent time:-
Target version:-

Description

Stored DOM-based vulnerabilities arise when user input is stored and later embedded into a response within a part of the DOM that is then processed in an unsafe way by a client-side script. An attacker can leverage the data storage to control a part of the response (for example, a JavaScript string) that can be used to trigger the DOM-based vulnerability.

DOM-based cross-site scripting arises when a script writes controllable data into the HTML document in an unsafe way. An attacker may be able to use the vulnerability to construct a URL that, if visited by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.

The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.

Users can be induced to visit the attacker's crafted URL in various ways, similar to the usual attack delivery vectors for reflected cross-site scripting vulnerabilities.

Solution Given :

The most effective way to avoid DOM-based cross-site scripting vulnerabilities is not to dynamically write data from any untrusted source into the HTML document. If the desired functionality of the application means that this behavior is unavoidable, then defenses must be implemented within the client-side code to prevent malicious data from introducing script code into the document. In many cases, the relevant data can be validated on a whitelist basis, to allow only content that is known to be safe. In other cases, it will be necessary to sanitize or encode the data. This can be a complex task, and depending on the context that the data is to be inserted may need to involve a combination of JavaScript escaping, HTML encoding, and URL encoding, in the appropriate sequence.

sc.png (19 KB) Najmi Pasarudin, December 03, 2020 12:11

H1 - 1.jpg (205 KB) Nurul Athira Abdul Rahim, December 04, 2020 12:54

H1 - 2.jpg (179 KB) Nurul Athira Abdul Rahim, December 04, 2020 12:54

H1 - 3.jpg (196 KB) Nurul Athira Abdul Rahim, December 04, 2020 12:54

History

#1 Updated by Nurul Athira Abdul Rahim almost 4 years ago

  • Priority changed from Normal to High

#2 Updated by Najmi Pasarudin almost 4 years ago

  • Status changed from New - Begin Life Cycle to Development / Work In Progress

#3 Updated by Najmi Pasarudin almost 4 years ago

  • Due date set to December 03, 2020

#4 Updated by Najmi Pasarudin almost 4 years ago

  • % Done changed from 0 to 90

#5 Updated by Najmi Pasarudin almost 4 years ago

Solution:
Display data using struts

#6 Updated by Najmi Pasarudin almost 4 years ago

  • Status changed from Development / Work In Progress to Internal Testing
  • Assignee changed from Najmi Pasarudin to Nurul Athira Abdul Rahim

Test case:
1. Access CDB>Message Box
2. Compose new message with <script>alert(123123123)</script>
3. Expected result, can save message without any alert popup.

#7 Updated by Nurul Athira Abdul Rahim almost 4 years ago

  • File H1 - 1.jpg added
  • File H1 - 2.jpg added
  • File H1 - 3.jpg added
  • Status changed from Internal Testing to Work Completed-End life cycle
  • % Done changed from 90 to 100

Tested and passed

#8 Updated by Nurul Athira Abdul Rahim over 3 years ago

  • Status changed from Work Completed-End life cycle to System Integration Test

#9 Updated by Nurul Athira Abdul Rahim about 3 years ago

  • Status changed from System Integration Test to Work Completed-End life cycle

Pending for 2nd scanning report

Also available in: Atom PDF