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. Web Development
  3. ASP.NET
  4. Cross Script Attacks

Cross Script Attacks

Scheduled Pinned Locked Moved ASP.NET
databasetoolshelpquestion
4 Posts 3 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.
  • B Offline
    B Offline
    BobsAfro
    wrote on last edited by
    #1

    I am trying to prevent from cross script attacks on my site. Trouble is that it is a shared database and I can't garuntee the data coming back is not dangerous. So I am trying to HtmlEncode all data coming from the database. I am using a data access class to fetch all data. This class has a few methods to do this in different forms. Encoding a dataset is easy because you can simple loop through every item and encode it. The problem is with a DataReader. All items are read only so how i can I encode them before they are passed to other classes as a DataReader? Any Ideas? Also is there a better way to encode all data? Like when it is rendering? because nearly everything needs to be encoded.

    B P 2 Replies Last reply
    0
    • B BobsAfro

      I am trying to prevent from cross script attacks on my site. Trouble is that it is a shared database and I can't garuntee the data coming back is not dangerous. So I am trying to HtmlEncode all data coming from the database. I am using a data access class to fetch all data. This class has a few methods to do this in different forms. Encoding a dataset is easy because you can simple loop through every item and encode it. The problem is with a DataReader. All items are read only so how i can I encode them before they are passed to other classes as a DataReader? Any Ideas? Also is there a better way to encode all data? Like when it is rendering? because nearly everything needs to be encoded.

      B Offline
      B Offline
      blue_arc
      wrote on last edited by
      #2

      If it is written in document that use Datareader then You have to search lil more... or else just don;t use Datareader.... because u can then also work fine...

      Ravi Kant Srivastava (System Analyst) HandsOn Technology & Engineering Gurgaon (India) e-mail:ravikant@hte.co.in

      B 1 Reply Last reply
      0
      • B blue_arc

        If it is written in document that use Datareader then You have to search lil more... or else just don;t use Datareader.... because u can then also work fine...

        Ravi Kant Srivastava (System Analyst) HandsOn Technology & Engineering Gurgaon (India) e-mail:ravikant@hte.co.in

        B Offline
        B Offline
        BobsAfro
        wrote on last edited by
        #3

        ummmm... okay thanks. Anyone else any ideas?

        1 Reply Last reply
        0
        • B BobsAfro

          I am trying to prevent from cross script attacks on my site. Trouble is that it is a shared database and I can't garuntee the data coming back is not dangerous. So I am trying to HtmlEncode all data coming from the database. I am using a data access class to fetch all data. This class has a few methods to do this in different forms. Encoding a dataset is easy because you can simple loop through every item and encode it. The problem is with a DataReader. All items are read only so how i can I encode them before they are passed to other classes as a DataReader? Any Ideas? Also is there a better way to encode all data? Like when it is rendering? because nearly everything needs to be encoded.

          P Offline
          P Offline
          Paddy Boyd
          wrote on last edited by
          #4

          You could extend the DataReader class with and override the ToString method to HTMLEncode everything.

          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