Author Topic: Someone was paid for this  (Read 2234 times)

webwhy

  • Jackass IV
  • Posts: 608
  • Karma: +15/-10
Someone was paid for this
« on: July 09, 2011, 01:09:11 PM »
We were just awarded a maintenance contract for a local bank's public website and intranet.  both were created by a local advertising and marketing firm who "specializes" in the web.  during our typical security review we found this (amongst a shit load of other problems)


<?php
  
if($_SESSION['loggedin'] != 'yes') {
?>
  <script type="text/javascript">
    alert('You have either linked to this page directly or your session has expired.  Please login to continue');
    window.location = 'http://foo.com/bar/login.php'
  </script>

<?php
  
}
?>


This was the authentication check for the content management for the website.  Insane!  I've never seen something like this especially when the developer is getting paid real money to build it.  Needless to say, the VP we deal with was scary pissed when we reported all of the security holes we found in both sites.

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: Someone was paid for this
« Reply #1 on: July 09, 2011, 06:41:24 PM »
so, if you turned javascript off it wouldn't log you out?  nice!
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

webwhy

  • Jackass IV
  • Posts: 608
  • Karma: +15/-10
Re: Someone was paid for this
« Reply #2 on: July 10, 2011, 12:33:01 PM »
basically if you turn javascript off, you can bypass authentication and you have full access to the administration of the the website's cms.  whoever developed this obviously doesn't (didn't) understand http at all...

JaWiB

  • definitelys definately no MacGyver
  • Jackass V
  • Posts: 1443
  • Karma: +57/-4
Re: Someone was paid for this
« Reply #3 on: July 10, 2011, 06:22:10 PM »
So the fix was to wrap the rest of the page in an 'else' statement?

webwhy

  • Jackass IV
  • Posts: 608
  • Karma: +15/-10
Re: Someone was paid for this
« Reply #4 on: July 10, 2011, 09:46:05 PM »
So the fix was to wrap the rest of the page in an 'else' statement?

fix was to redirect through http and kill the execution of the script.


<?php
  
if($_SESSION['loggedin'] != 'yes') {
    
header("Location: https://foo.com/bar/login.php");
    die;
  }
?>


JaWiB

  • definitelys definately no MacGyver
  • Jackass V
  • Posts: 1443
  • Karma: +57/-4
Re: Someone was paid for this
« Reply #5 on: July 13, 2011, 12:36:39 AM »
Gotta love any language that includes a function called "die." I often find myself screaming that at code written by other people, but alas I have no other recourse.

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Someone was paid for this
« Reply #6 on: July 13, 2011, 01:10:42 AM »
Gotta love any language that includes a function called "die." I often find myself screaming that at code written by other people, but alas I have no other recourse.
PHP should add a diaf construct :D