Let’s play a game: what is the deadly bug here?

Поділитися
Вставка
  • Опубліковано 25 січ 2018
  • This short php code contains a critical vulnerability. In this video I will explain in detail what I think while analysing it.
    Original source of challenge: www.securify.nl/en/blog/SFY20...
    Link to tweet: / 951499972582703104
    =[ ❤️ Support ]=
    → per Video: / liveoverflow
    → per Month: / @liveoverflow
    =[ 🐕 Social ]=
    → Twitter: / liveoverflow
    → Website: liveoverflow.com/
    → Subreddit: / liveoverflow
    → Facebook: / liveoverflow
    =[ 📄 P.S. ]=
    All links with "*" are affiliate links.
    LiveOverflow / Security Flag GmbH is part of the Amazon Affiliate Partner Programm.
    #CodeAudit #WebSecurity

КОМЕНТАРІ • 665

  • @ColinRichardson
    @ColinRichardson 6 років тому +1184

    Note to self.. Check types of incoming information, not just that it exists.

    • @96shahab
      @96shahab 6 років тому +32

      Note to self.. Do that too

    • @donwald3436
      @donwald3436 6 років тому +14

      That is called type checking, where have you heard of this before?

    • @-eurosplitsofficalclanchan6057
      @-eurosplitsofficalclanchan6057 6 років тому +4

      Just real escape sting chill

    • @donwald3436
      @donwald3436 6 років тому +1

      「ᗴᔕ」- EuroSplits Offical Clan Channel
      real escape 2 mysql i, couldn't even get escaping right after two attempts.

    • @MatthijsvanDuin
      @MatthijsvanDuin 6 років тому +32

      Only in PHP though, since no other language would be stupid enough to implicitly decode HTTP POST variables into structured data types, thereby burdening all programmers by having to type-check incoming POST variables. :P

  • @dunste123
    @dunste123 3 роки тому +104

    Fun fact: in PHP 8 these warnings for incorrect types passed to functions kill the script with an error instead

    • @edgeeffect
      @edgeeffect 2 роки тому +4

      AT LAST! I've waited through 5 major versions of PHP for them to get rid of this truly awful excuse for an error system.

    • @TheStiepen
      @TheStiepen 2 роки тому +19

      Ah that's why so much PHP code isn't compatible with PHP 8 :D

    • @sebastiangudino9377
      @sebastiangudino9377 Рік тому +3

      ​@@TheStiepenThat also why PHP8 is actually a useful programing language where you don't have to worry about this type of things

  • @MichaelButlerC
    @MichaelButlerC 6 років тому +376

    this is why every production php application should hard crash on warnings

    • @inx1819
      @inx1819 5 років тому +10

      try{...} catch (...) {echo "Error!"}; ???????????

    • @rogercruz1547
      @rogercruz1547 5 років тому +20

      @@inx1819 Warnings don't throw exceptions...
      You would have to make a plugin/extension of some sorts or call an output checking function after every potentially dangerous call.
      Or checking for null on those hmacs...

    • @SpareSomeChange8080
      @SpareSomeChange8080 5 років тому +7

      @@rogercruz1547 Easy to get this setup with set_error_handler and having that handler throw an ErrorException based on what error number is triggered.

    • @edgeeffect
      @edgeeffect 2 роки тому +1

      Speaking as a PHP developer of many many years.... warnings are a CURSE! ........ PHP is a curse

  • @ZeroUm_
    @ZeroUm_ 5 років тому +53

    "Let's craft a cryptographic function which is very likely to be used in security contexts, and let's not fail when unexpected things are passed to us. What could go wrong." I'm livid.

  • @toddkfisher
    @toddkfisher 6 років тому +1925

    The deadly bug is PHP itself.

    • @logs
      @logs 6 років тому +40

      Your face seems to be a bigger bug.

    • @MarcoMorelos
      @MarcoMorelos 6 років тому +47

      Every time I hear of PHP I hear about all these attacks and insecurities. It makes me nervous

    • @logs
      @logs 6 років тому +45

      Meh, that's bullshit. PHP is the most used web language.
      Even Facebook is made with PHP.

    • @camwhite1697
      @camwhite1697 6 років тому +16

      MusicAddiction Although Facebook uses their own modified version of PHP, it is the same. Much of their backend servers are implemented in C++ anyways

    • @logs
      @logs 6 років тому +15

      I think FB is using HHVM aka "Facebook HipHop" or so. But yeah their servers could possibly be C++, but the fact that Facebook's main preferable programming language was PHP proofs all these "PHP sucks" commenters wrong.

  • @JonathanGray89
    @JonathanGray89 6 років тому +415

    That HMAC function definitely should have just thrown an error. It is incumbent on the programmer to know all possible states of a given algorithm, but if you look at the documentation null isn't even listed as a possible return value for hash_hmac. The fact that it's a cryptographic function, I almost have to wonder if that was put there intentionally. This definitely shows the importance of proper user-input sanitization.

    • @BonBaisers
      @BonBaisers 5 років тому +65

      Exactly, this function should throw exception for any parameter being null because doing so makes no sense at all. That does not give a good impression on PHP.

    • @apuherra8864
      @apuherra8864 5 років тому +40

      The fact that the null output on wrong input type is undocumented in official PHP docs is just terrible. Also, not erroring out when giving inputs of wrong type is not something PHP crypto functions are famous of. A good programmer must always check the types of inputs and also preferably the output type before continuing to keep the code safe.

    • @BonBaisers
      @BonBaisers 5 років тому +3

      @@apuherra8864 I get this and agree with you. But when you make a lib you can't expect people to read the source code (if available) and understand what flaws the code you have written can introduce in their code. As a software architect, I always ensure my teams code follow the Design by contract (DbC) principles. In this case, and it's a good one, hash_hmac should check Preconditions and Postconditions (arg types should be strings, not empty and result should not be a predictable result as a hashed \0 string or empty hashed managed string, etc...). This 2 or 3 lines of code could save systems from vulnerabilities and save the purpose of the dev using your lib trying to secure their systems or APIs. I often read or reverse engeneer dotnet framework code and I'm always happy to check that they follow the DbC pattern.

    • @apuherra8864
      @apuherra8864 5 років тому +5

      @@BonBaisers I mostly agree, but you _should_ change your "should" mindset to "must" in many places as per RFC 2119. Keeping "shoulds" when designing and not erroring out all the way back to where the error came on unintended circumstances just allows these hash_hmac types of bugs (or _may_ I say, undocumented features) to happen.

    • @Selur91
      @Selur91 5 років тому +2

      # Never trust parameters from the scary internet, only allow the white list through.

  • @maxwellsmart3156
    @maxwellsmart3156 3 роки тому +6

    I originally thought the "deadly bug" was the use of PHP.

  • @BlackJacketWasp
    @BlackJacketWasp 5 років тому +5

    Thanks for the super detailed walkthrough. I love how you concisely laid out your thought process and the various ideas you had or the checks to do, whether they worked or not for this instance.

  • @akineko9073
    @akineko9073 6 років тому +3

    this is the fourth vid i have watched by you and i have to say, youre a real mvp.
    I am interested very much in the stuff you cover on your channel, but not enough to really get into it or to justify dropping other hobbies for it.
    Thank you for more or less staying at the same niveau of needed knowledge for the most part. great content, keep it up ^^

  • @jpersson8718
    @jpersson8718 3 роки тому +8

    "Stupid brain, so unreliable"
    Story of my life....

  • @rajkhattar2830
    @rajkhattar2830 6 років тому

    Man you are doing an amazing job at these kind of videos ! Really enjoyed this one ! Keep making similiar kinds of videos . Getting into the nooks-n-crooks of things is what I always wanted !

  • @ItsLogic
    @ItsLogic 4 роки тому +15

    I watched this video first a year ago, and now I am watching it again. I understand so much more but don’t feel like I could even get close to solving it. December 2020 I will come back and see what I think then.

    • @Omar-wm9kz
      @Omar-wm9kz 3 роки тому

      am waiting for ur comment and i will come in december 2021 cuz itz my firsr time here.

    • @ZoMbiE4CoBRA
      @ZoMbiE4CoBRA 2 місяці тому +1

      so what happened? did you get close to solving it after 4 years?

    • @abdirahmann
      @abdirahmann 2 місяці тому +2

      @@ZoMbiE4CoBRA you actually reminded him 🤣🤣🤣

  • @aspektx
    @aspektx 6 років тому +4

    I can't code, but you explain well enough that I'm actually beginning to understand bits and pieces and patterns.

  • @dtaPacman
    @dtaPacman 6 років тому +1

    Thankyou! as someone trying teach themselves code, your explanations were really informative.

  • @automata8973
    @automata8973 6 років тому +5

    This video after long time reminded me of what amount fun we can have. Thanks for the great video.

  • @martolomiuu
    @martolomiuu 6 років тому +1

    Thanks to the subtitles i can underestand all ty liveoverflow

  • @TaiKahar
    @TaiKahar 6 років тому +1

    Nice videos. I enjoy them (even though I already know a lot of the stuff). Your way of thinking matches a lot of how I think when looking at code.

  • @LKD70
    @LKD70 5 років тому +5

    I started with Php when I was a young teen... Misplacing the argument/parameters in methods is far too easy and common. Php is a language of inconsistencies, always important to triple check for that sort of thing.

  • @seanpianka1818
    @seanpianka1818 6 років тому

    This is absolutely awesome. Thank you for making this.

  • @triularity
    @triularity 6 років тому +10

    You left out the Environment Elephant in the code room issue. On unixy servers that have multiple users, it is often easy to see the environment variable values of another user's processes. So if anyone else on that server can see your secret, they could possibly do more damage than just what that one script has access to. This is a known security issue that has popped up at times over the decades.
    In hardened OSs, users may be blocked from seeing the process of other users (and thus their environment), but that shouldn't be assumed in web code.

  • @roger109z
    @roger109z 4 роки тому +4

    I honestly had no idea you could pass an array like that

  • @windowsforvista
    @windowsforvista 6 років тому +1

    This was such a good video! Please make more like this. You've earned a loyal subscriber :)

  • @Otakutaru
    @Otakutaru 6 років тому +89

    So... The vulnerability was actually 2 dumb and exploitable vulnerabilities... That hash_hmac function gives a WARNING when fed an array and returns a NULL?? also... the secret can be NULL... (facepalm). What gives? What is the benefit of having a NULL secret? Please, let me know, I'm puzzled.

    • @JakeN482
      @JakeN482 6 років тому +5

      Maybe it inherited the old minute man nuke doctrine's 00000000 input? Or more seriously it might be a feature for the unit testing framework of the hmac implementation, and it's got hard coded outputs that return sooner than when a secret exists. I doubt oracle has such a unit testing framework for php though, it's one of the buggiest and least consistent languages out there. The most likely scenario is that it just doesn't care if the input is null, and processes it as if it were 0.

    • @1e1001
      @1e1001 6 років тому

      It's so that the secret is predictable, so the last if statement would not run and stop the program

    • @Otakutaru
      @Otakutaru 6 років тому +4

      RedMikePumpkin Yeah, I got it. I was asking about what were the developers thinking when they coded the function.

    • @rogercruz1547
      @rogercruz1547 5 років тому +10

      @@Otakutaru The core php devs, thinking while coding? That's a new one

    • @LiEnby
      @LiEnby 4 роки тому

      NULL == 0 so the secret is really just 0, which makes sense to work.

  • @Zzznmop
    @Zzznmop 6 років тому +2

    Thanks for another awesome video!! This channel gets me pumped to capture some flags :D

  • @shreyas_._
    @shreyas_._ 6 років тому

    Every single video on this channel is amazing and 100% informative. .....
    I love this channel....

  • @BunniBuu
    @BunniBuu 6 років тому +1

    I don't know anything about coding and UA-cam recommended this video. I have no idea what was talked about in this video but keep it up, good stuff.

  • @juliavanderkris5156
    @juliavanderkris5156 5 років тому

    Awesome video! Really made me understand better how to approach something like this.

  • @Warmonger1178
    @Warmonger1178 5 років тому +10

    I’m surprised you didn’t at least mention the timing unsafe hash comparison. PHP has a built in hash_equals() function to mitigate...

  • @azazmir9340
    @azazmir9340 5 років тому

    more of these challenges please

  • @Entropy67
    @Entropy67 11 місяців тому

    Great video, i got to the same part as you at the end but i couldn't figure out what kind of input would change the type, and I got lazy and just watched the video instead

  • @Hyperverse
    @Hyperverse 5 років тому

    I've watched a few of your videos now and this is the first time I really understood what you were saying. I learned about Hashing algorithms in my SEC+ class. I just wanted to share my happiness for knowing like 80% of what you were saying.

  • @JohnOmbagi
    @JohnOmbagi 5 років тому +1

    I love how you explain it. :D

  • @user-pj3uv6re7s
    @user-pj3uv6re7s 6 років тому +1

    Uncovering the deadly bug was truly exciting !

  • @MuhammadMuhaddis
    @MuhammadMuhaddis 5 років тому

    Your logics are amazing!

  • @Calmerism
    @Calmerism 3 роки тому +1

    whatching php bugs is just like watching wheels turn. It never ends.

  • @sentinalprime8838
    @sentinalprime8838 3 роки тому

    Amazing video man i have been learning a lot in this lock down this is all because of you and John Thanks a lot for making videos and spreading knowledge amazing work . Lots of respect to all those who share knowledge.....

  • @honkatatonka
    @honkatatonka 6 років тому +150

    This is the first time I understand why people dislike PHP ... cheesus. EDIT: is this hash_hmac part of the core lib or some 3rd party screw up?

    • @LiveOverflow
      @LiveOverflow  6 років тому +65

      part of core php.net/manual/en/function.hash-hmac.php

    • @DeusEx3
      @DeusEx3 6 років тому +66

      honkatatonka I was thinking the same thing. Wow. I even checked the docs and they didn't mention returning null sometimes. I'm shocked in the nerdiest of ways...

    • @jarrodp5410
      @jarrodp5410 5 років тому +3

      honkatatonka wow this is a new type of language

    • @Dragiux
      @Dragiux 5 років тому +7

      @@DeusEx3 www.php.net/manual/en/function.hash-hmac.php#122657 remember to read comments. PHP documentation is notoriously incomplete.

  • @sametaylak2698
    @sametaylak2698 6 років тому +1

    Pretty good. Thank you for sharing your knowledge

  • @ltstaffel5323
    @ltstaffel5323 6 років тому

    Love this kind of video and would like to see more like it!

  • @WrenchIO
    @WrenchIO 10 місяців тому

    learned a lot , thanks for your video

  • @melihcelik9797
    @melihcelik9797 5 років тому +2

    Very good explanation, but as an habit I always check if a variable is null if the function may return null. That is a great example how it can have effects on live servers, not very visible at the beggining but if someone covers it your data and privacy is gone.
    Oh, also your money too.

  • @EmmanuelIbikunle
    @EmmanuelIbikunle 6 років тому +3

    Great video ... thanks man for sharing

  • @renakunisaki
    @renakunisaki 5 років тому

    PHP is always so full of surprises!

  • @aaronknobloch2332
    @aaronknobloch2332 6 років тому +2

    I really liked this video topic and format. Thanks!

  • @Videonauth
    @Videonauth 5 років тому +16

    On top of what you found the last line itself is a deadly bug, Passing data directly into exec opens a door for all kinds of injections.

    • @AnPham-uz3td
      @AnPham-uz3td 4 роки тому +2

      That last line is so obvious that anyone can see. I think the problem was meant for you to find the non-trivial bug, the last line only for getting the content of flag file on the machine (if it was in CTF).

  • @KamiKagutsuchi
    @KamiKagutsuchi 6 років тому +387

    It's php, that's your deadly bug right there.

    • @G4MR1
      @G4MR1 6 років тому +30

      oh boi if you think that's bad, go look up "Heartbleed" which was written in C. Doesn't really matter the language, most common errors in programming are almost always caused by human error.

    • @Jacksonbanan
      @Jacksonbanan 6 років тому +4

      KamiKagutsuchi I thought the same thing haha

    • @honkatatonka
      @honkatatonka 6 років тому +20

      Come on, C is so barebones. But having such a loose unintuitive API as hash_hmac is just bad

    • @simivb
      @simivb 6 років тому +4

      Well this particular error is caused by weak typing and not compiling. You can of course make horrible mistakes in any languages, but those two things really don't help you in preventing mistakes.

    • @dreamyrhodes
      @dreamyrhodes 6 років тому +12

      honkatatonka true. hash_hmac is just bad in this case. It should never return NULL where you expect it to get a hash. Input type violation should result in a fatal error, not a warning.

  • @gabrielkwiecinskiantunes8950
    @gabrielkwiecinskiantunes8950 6 років тому

    I subscribed instantly after the logo animation.

  • @user-bw3fm4cd6y
    @user-bw3fm4cd6y 6 років тому +12

    thumbs up for using redstar os. ;)

  • @marcelocarmeiro
    @marcelocarmeiro 6 років тому

    Excellent explanation. You deserve my subscribe.

  • @metalpachuramon
    @metalpachuramon 6 років тому

    This was nice, I thought that too, but only when I ran out of options

  • @metaorior
    @metaorior 6 років тому

    Love your channel !!
    keep up :p

  • @XuanbinLor
    @XuanbinLor 5 років тому

    Very insightful

  • @madisonhanberry6019
    @madisonhanberry6019 6 років тому

    I'm loving these educational videos! Do you know any good resources for getting started with digital CTF?

  • @PedroMAMoura
    @PedroMAMoura 6 років тому

    Always great!

  • @secureitmania
    @secureitmania 4 роки тому

    Bro I am missing your videos 😭😭.. keep upload this type of videos

  • @roguesecurity
    @roguesecurity 6 років тому

    Another awesome video. Thanks

  • @tw11tube
    @tw11tube 4 роки тому

    I expected a completely different approach to that challenge when I reviewed the code in the beginning. I guessed that the challenge description contains an example invocation of that PHP script *without* the optional nonce, so you know the HMAC for one specific safe string like "www.google.com". In that case, you could input the safe string as nonce, and the new nonce-specific secret will be the public HMAC for the safe string, which enables you to calculate the HMAC for any input you want.

  • @MayankSharma
    @MayankSharma 6 років тому

    Awesome!!! Thanks for sharing.

  • @frootube5662
    @frootube5662 4 роки тому +1

    why does youtube not recommend people like you... why do i have to search so hard!!!

  • @sucrose
    @sucrose 6 років тому

    Thanks for the tips!

  • @kken8766
    @kken8766 4 роки тому

    thx for making videos like this.

  • @AlSupertramp0
    @AlSupertramp0 6 років тому +98

    Also, timing attack on "!==" might be possible.

    • @abdilahrf
      @abdilahrf 6 років тому +8

      how ?

    • @Fs3i
      @Fs3i 6 років тому +124

      Abdillah Muhamad String-Equals stops as soon as a difference is found. So (simplified) you put in a hmac beginning with an 'a' and measure the time the script takes to run, then you do it with a 'b', 'c',
      .. - for one input the string-comparison will take slightly longer because it has to check the second letter as well. That will be your first letter.
      Even if you try every start-character 1000x times, it would still only take (256 / 4 = 64'000) requests to the server, which is easily feasible within minutes.
      In reality it's a bit harder because string-equals usually checks more than one character at a time.
      And if you want to defend against it: look up constant time string equality checks.

    • @SweetHyunho
      @SweetHyunho 6 років тому +25

      Fly - Thanks, I learned something useful today.

    • @macccu
      @macccu 6 років тому +47

      sorry but this sounds like a bs. You would need PERFECTLY SAME network and server conditions on EVERY request to even have a chance at measuring execution time. I dont even think you could measure difference between php reaching second or third char

    • @theapexsurvivor9538
      @theapexsurvivor9538 6 років тому +5

      macccu well, you can measure it against your server ping, so then you don't need the same conditions because you have a standard measurement.
      And you could just submit more detailed variables, ie have the first 3 digits vary and then you should have a slight difference in the vicinity of the correct string, so you have your first 2 digits, rinse and repeat to get the rest.

  • @ericspeidel7593
    @ericspeidel7593 5 років тому

    Interesting analysis, thanks!

  • @sigithermawan277
    @sigithermawan277 3 роки тому

    it s so simple sir
    and i like you

  • @inferno3853
    @inferno3853 4 роки тому +1

    before watching: does it have to do with the exec? and couldn't you basically use the post value as a way to run code through it? (i never really looked at php, i have little to zero knowledge what the code does but i can assume)
    edit: ah nvm

  • @marimuthumanoj7206
    @marimuthumanoj7206 4 роки тому

    This is such a great video

  • @Davimejor
    @Davimejor 6 років тому

    amazing men! really good content!

  • @brianzhou1806
    @brianzhou1806 6 років тому

    Great content, keep it up!

  • @bjornroesbeke
    @bjornroesbeke 6 років тому +1

    Great thinking. In the end it's all so obvious!
    There must be so many vulnerabilities in my code...

    • @rogercruz1547
      @rogercruz1547 5 років тому

      I'm worried I have a framework written in this thing... and I'm not sure the hmac bullshittery is documented in the phpsadness page

  • @sleaf6
    @sleaf6 6 років тому

    how did i not know about this channel until now?!

  • @KunalSaini97
    @KunalSaini97 4 роки тому +1

    Literally every word went above my head.....
    Still watched the whole video xD

  • @dcrasch
    @dcrasch 5 років тому

    Awesome! What do you use to annotate your videos?

  • @djthomasx
    @djthomasx 5 років тому

    Awesome video!

  • @KaleshwarVhKaleshwarVh
    @KaleshwarVhKaleshwarVh 3 роки тому

    Beautiful.

  • @TheSam1902
    @TheSam1902 6 років тому

    Thanks TIL you can pass an array as a POST value, nice

  • @padmakumarnxt
    @padmakumarnxt 4 роки тому

    Great video. Keet it coming.

  • @d1rtyharry378
    @d1rtyharry378 4 роки тому

    Damn that! When I first saw this I didn't couldn't understand shit. But, today I saw it again and now that I understand it, I wanna explore more. Thanks man! You inspire me to keep going

  • @madanugraha8587
    @madanugraha8587 5 років тому

    omg this channel is so great ! ! ! !

  • @shefalikumari3513
    @shefalikumari3513 3 роки тому

    Wonderful

  • @x0r1k
    @x0r1k 5 років тому

    the biggest bug is that input for the exec was not escaped at all

  • @TheGrimravager
    @TheGrimravager 4 роки тому +1

    I watched this video when it came out.
    2 years later I am a php developer and I watched it again. It felt completely different :)

    • @Omar-wm9kz
      @Omar-wm9kz 3 роки тому

      why and how?

    • @TheGrimravager
      @TheGrimravager 3 роки тому

      @@Omar-wm9kz I learned how php works and have worked with it on a daily basis, makes you pick up things almost instantly where otherwise you wouldn't even consider them

  • @salimal-badi7063
    @salimal-badi7063 6 років тому

    مبدع ، great man ✌️

  • @thepvporg
    @thepvporg 5 років тому

    There is no salting value to generate a value to test against the hash issued, no filter_var on the input and no white listing and the exec function can be exploited.

  • @ajxbjj
    @ajxbjj 6 років тому

    Arrays was my first thought :)

  • @yiannissiantos127
    @yiannissiantos127 6 років тому +5

    Most PHP frameworks turn warnings/notices/errors into exceptions so that will mitigate these sort of issues.

  • @liammaclennan1402
    @liammaclennan1402 5 років тому

    Would a vulnerability in the code only allow an XXS and SQL attack or are there other attacks that can be executed ?

  • @sliyarohmodus5749
    @sliyarohmodus5749 5 років тому

    The host parameter is not sanitized. An attacker can pass extra commands to the exec function and cause them to be executed at the same privilege level as the php script.

  • @vukkulvar9769
    @vukkulvar9769 6 років тому +6

    An other possibility is PHP is configured so all errors are fatal. If the PHP do not have an error handler, it usually display them with the scope variables. That would expose the value of $secret, allowing you to forge any signature to futur requests.

    • @MaakaSakuranbo
      @MaakaSakuranbo 6 років тому

      Huh? Usually when PHP errors for me it just goes 500, not showing any data. If theres any data shown it's in the error.log, which of course someone from outside shouldn't be able to access.

    • @vukkulvar9769
      @vukkulvar9769 6 років тому

      It's a PHP configuration. Some people forget "development" mode that'll format the errors and exceptions into a HTML response

    • @BikingWIthPanda
      @BikingWIthPanda 6 років тому

      display_errors = On

  • @snowdaysrule
    @snowdaysrule 5 років тому

    I actually got as far as determining that the goal here would be to set a value for nonce that would allow you to compute the hmac that made the !== statement true, but I'm not a programmer so wasn't able to determine on my own what to set the nonce to. I was really big into studying the security of the xbox 360 and learning how all the exploits worked so that definitely helped me out here.

  • @MidnightSt
    @MidnightSt 6 років тому +1

    9:47 i had to get here and get reminded that you can to client-side php arrays, and then... i bet that if you supply an empty array, isset == true, but then output of the hash functions is either predictable, or a predictable gibberish (for example it spits out null or false or something like that), making all the rest of the checks "pass" == get skipped, basically

  • @UnwovenSleeve
    @UnwovenSleeve 6 років тому

    I understood none of that, but have the feeling that I learned something.

  • @royalpie
    @royalpie 6 років тому

    I also browse the PHP docs in incognito.

  • @mu11668B
    @mu11668B Рік тому

    I clicked only after you mentioned about the array input trick. It's not even a thing in languages I usually use. They just throw uncaught exceptions and crash.

  • @89elmonster
    @89elmonster 6 років тому

    Subbed, good channel 👍

  • @PiesekLeszek90
    @PiesekLeszek90 6 років тому

    You could also make 'host' variable an array (and somehow put code that you want to execute in it) and send 'hmac' as null, right? Someone correct me if I'm wrong.

  • @MrKristian252
    @MrKristian252 6 років тому

    More of this! +1 sub after just 3 minute in.

  • @IslamIsDanger
    @IslamIsDanger 3 роки тому

    Great!

  • @Ulvis_B
    @Ulvis_B 4 роки тому

    first seen code thinking about null bug

  • @dagobert6420
    @dagobert6420 5 років тому

    There is one thing I didn't get.. the Post-Variable isnt checked anyway so in line 10 as an attacker I could simply put " null,null); exec(evilcode); /* " into the Post['nonce'] and its done anyway ? Am I missing something?

  • @windchime9720
    @windchime9720 6 років тому

    That was awesome!!!