Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. DOM XSS and createElement() and getElementsByTagName() methods

DOM XSS and createElement() and getElementsByTagName() methods

Scheduled Pinned Locked Moved Java
javascriptquestionhtmlcomsecurity
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Supriya Tonape
    wrote on last edited by
    #1

    Hello, I am wondering if following methods in my script are vulnerable for DOM XSS attack? If yes, what is the best practice to write them. Kindly help if you can guide about it. 1. document.createElement() 2. document.getElementsByTagName() (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); Thank you for your time. Best Regards, Supriya

    L 1 Reply Last reply
    0
    • S Supriya Tonape

      Hello, I am wondering if following methods in my script are vulnerable for DOM XSS attack? If yes, what is the best practice to write them. Kindly help if you can guide about it. 1. document.createElement() 2. document.getElementsByTagName() (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); Thank you for your time. Best Regards, Supriya

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Wrong forum, that has nothing to do with Java, try http://www.codeproject.com/Forums/1640/Web-Development.aspx[^].

      S 1 Reply Last reply
      0
      • L Lost User

        Wrong forum, that has nothing to do with Java, try http://www.codeproject.com/Forums/1640/Web-Development.aspx[^].

        S Offline
        S Offline
        Supriya Tonape
        wrote on last edited by
        #3

        I am really sorry for that. Thank you for the correct group link. Best Regards, Supriya

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups