PHP Security: XSS (Cross-site Scripting)

Sdílet
Vložit
  • čas přidán 5. 10. 2015
  • Want more? Explore the library at www.codecourse.com/lessons
    Official site
    www.codecourse.com
    Twitter
    / teamcodecourse

Komentáře • 39

  • @cavking1
    @cavking1 Před rokem

    You taught me php over ten years ago and still use it today. Thanks Alex

  • @MartinKuikHilversum
    @MartinKuikHilversum Před 7 lety

    Nice work bro i was searching for this u helped me alot !

  • @IgorAherne
    @IgorAherne Před 7 lety

    Damnit, I am writing a database, and just whistle in fear the end of each video.
    For example, where you expose the prevented javascript for example, it's actually scary how it would go through so quickly and unnoticed.. Thanks!

  • @AlexanderGarzon
    @AlexanderGarzon Před 8 lety

    simple, but quite precise. Nice video.

  • @zezont4
    @zezont4 Před 8 lety +1

    Really important and easy.
    Thank you

  • @sanauwari
    @sanauwari Před 6 lety

    Finally got it what am I looking for😊Thanku very much

  • @victhour
    @victhour Před 8 lety +1

    man! like your reading my mind, nice tutorial.

  • @TeeWoTeebay
    @TeeWoTeebay Před 8 lety

    Nice and easy! Thanks Alex.

  • @mysterion4105
    @mysterion4105 Před 8 lety

    Thanks for the vídeo Alex, hope you upload other kind of attacks.

  • @gungorbudak
    @gungorbudak Před 8 lety

    Can anybody tell me what MySQL software here is to see and edit table rows?

  • @MohamedAliUrd
    @MohamedAliUrd Před 8 lety +2

    you are the best

  • @tsochetra
    @tsochetra Před 8 lety

    can i escape value before insert to db ?

  • @SinghatehAlagie
    @SinghatehAlagie Před 6 lety

    hello sir, I come across your video while I was trying to fix my cookie problem. when I inserted my cookies into the database and if I want to see them all in my cookie model I show your cart is empty while inside my database is having some products already inserted into them. could you please help me to fix that please or I can even send you the code to check it for me if necessary? thank you so much waiting to hear from you soon as possible.

  • @bcrypted
    @bcrypted Před 7 lety

    Is this still applies? or what will be the equivalent from 2015 to current year 2017?
    What version of PHP are you using in this videos?

  • @WouterDijkstra3119
    @WouterDijkstra3119 Před 8 lety

    Why not sanitize the data before entering the DB, I know you said something about it, but if you use htmlspecialchars or htmlentities before entering the DB I don't see why not do it before, rather than after?

    • @aidantwoods
      @aidantwoods Před 8 lety

      +Wouter Dijkstra If you sanitise the data before it reaches the DB, then messing up once will leave you vulnerable everywhere the malicious data is displayed. If you sanitise as things come out, then you'll limit your exposure to where you messed up.
      Additionally, if you sanitise before then a screw up is harder to fix, because your security model relies on the database being trusted not to have executable html inside it. A single screw up invalidates that assumption, and you'd have to find every piece of malicious data in the DB before you'd be safe - even after fixing the flawed form.
      If you sanitise after, then to remove an exploit all you have to do is fix the vulnerable page. Then it won't matter if there is malicious html in the DB, because it won't be able to execute.
      When outputting data, just ask yourself whether the data really needs the ability to execute as html. If the answer is no, run it through the sanitisation function.

  • @NoJackals
    @NoJackals Před 8 lety

    Why other videos of php security list are private?

  • @royhonders
    @royhonders Před 8 lety

    What software for the database is he/are you using?

    • @chillybinvids
      @chillybinvids Před 8 lety +1

      +Veslav I believe he uses Sequel Pro. If using Windows try HeidiSQL.

  • @hamedtech7260
    @hamedtech7260 Před 6 lety

    very helpful
    :)

  • @Dexter101x
    @Dexter101x Před 7 lety

    What if they don't use cookie?

  • @ialimijororakotoniaina3274

    very helpful

  • @MrAliiraqi1
    @MrAliiraqi1 Před 8 lety

    hi , Alex what u using editor

  • @abdullahislam
    @abdullahislam Před 8 lety +1

    So what about scripts we embed on our sites like facebook like box or a youtube embed? Can they potentially also steal cookies?

  • @meksaldi
    @meksaldi Před 8 lety

    +Codecourse Noticed that in the functions.php file you did not closed the ?> file at the end, is this the way it should?

    • @derkjna
      @derkjna Před 8 lety +2

      +meksaldi If a php file is include inside a other php file it isn't required to close PHP. Closing PHP while it is included in a other file could actually give you an error

    • @meksaldi
      @meksaldi Před 8 lety

      Exactly what I thought :) Thanks for the verification :

    • @Sonnentau1
      @Sonnentau1 Před 8 lety +2

      you should use 'require_once' anyway... thats better and saver.

    • @meksaldi
      @meksaldi Před 8 lety

      +Manolis Agkopian Ok re Manoli, euxaristw very much :D

  •  Před 5 lety

    Time when Alex was so underrated. 'Member?

  • @devexe3545
    @devexe3545 Před 8 lety

    ORM or PDO this will protect you from SQL injection.
    Twig or Smarty template framework This will protect you from XSS
    Token this will protect you from CSRF

  • @OJeyjunior
    @OJeyjunior Před 3 lety

    SAMY IS MY HERO

  • @JasonCtutorials
    @JasonCtutorials Před 8 lety

    this won't work on modern websites for php. LOLs.