Welcome, Guest. Please login or register.

Author Topic: The site is very slow...  (Read 21804 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: The site is very slow...
« Reply #89 from previous page: June 26, 2011, 05:02:57 PM »
Quote from: TheGoose;647173
Karlos has set the sanity injectors 10! Close your eyes!  :lol:


I know, it's very rare that I actually inject sanity into something :lol:
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: The site is very slow...
« Reply #90 on: June 26, 2011, 05:08:51 PM »
Note: I've merged this thread with the "intermittent 500 error" one that I started, since both issues tend to be discussed in this one more.

If anybody experiences any more 500 style errors (and you are able to do so), please post here.
int p; // A
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: The site is very slow...
« Reply #91 on: June 26, 2011, 06:17:28 PM »
Quote from: Karlos;647165
I've identified what may be the cause of most of the 500 errors. It's an old bug, originally reported by Piru:

http://www.amiga.org/forums/project.php?issueid=62

This is the fault of a 3rd party module that the site is which uses a vBulletin "hook" (injects some code) that thanks to a lack of sanity checking fails fatally on evaluation, causing the 500 error.
Ouch. This is ringing the "gaping security hole" alarm... I hope that user input isn't part of the injected code in any way... indeed eval() must die.

Quote
Disabling the module is not an option for now, I've added a quick work-around (injects the required sanity checks into the hook - lol, injecting the injected code...)
Duct tape to the rescue :-)

PS. I did get the 500 error once maybe an hour ago. Also the site seems to run a bit slow but only intermittently.
« Last Edit: June 26, 2011, 06:19:53 PM by Piru »
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: The site is very slow...
« Reply #92 on: June 26, 2011, 06:36:40 PM »
Quote from: Piru;647188
Ouch. This is ringing the "gaping security hole" alarm... I hope that user input isn't part of the injected code in any way... indeed eval() must die.

Yeah, vBulletin "depends" on it to support hooks, but php's eval() function is truly evil.

However, at least the eval()'d code in question comes from a database, not from any user-supplied input, which as you say, would be *seriously* bad.

Quote
Duct tape to the rescue :-)

No kidding. Check this out:

Code: [Select]
// References to "vbam" need to check that it actually is an object before invoking methods on it, but they don't
// The basic type information would be nice for an instanceof check instead of this
if (strpos($hook, 'shareads')!==false) {
$hook = str_replace(
'$output = $vbam->',
'if (is_object($vbam)) $output = $vbam->',
$hook
);
}
eval($hook);

How nasty is that? :lol:

Luckily the offending string in $hook is about 20 lines of fairly basic code after I got it logged, with two method calls on $vbam, neither of which did any checks to see if $vbam even contains a value, let alone whatever object type it was expecting. This is a temporary fix until I can find out where in the database the actual code lives and fix it properly.

Quote
PS. I did get the 500 error once maybe an hour ago. Also the site seems to run a bit slow but only intermittently.

There are other potential sources of 500 errors, but I've not seen one caused by this particular problem since the duct tape above.
« Last Edit: June 26, 2011, 06:39:38 PM by Karlos »
int p; // A
 

Offline TheGoose

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1458
  • Country: us
  • Gender: Male
    • Show only replies by TheGoose
    • http://www.amiga.org/forums/blog.php?u=827
Re: The site is very slow...
« Reply #93 on: June 26, 2011, 08:13:12 PM »
if (strpos($hook, 'shareads')!==false) {
   $hook = str_replace(
      '$output = $vbam->',
      'if (is_object($vbam)) $output = $vbam->',
      $hook
   );


Eeewww, so you are actually running a string replace on the actual vbulletin code that is suspect, why not just fix it at the source then patching it at run time?

So the replacement part here does the extra step of seeing if the $vbam is in fact an object first, if so, let it go and set it to be the $output

duct tape, if it works....
G1200, A3000D, A1200 PPC AOS4.0C

I\'m on Google +
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: The site is very slow...
« Reply #94 on: June 26, 2011, 08:16:10 PM »
Quote from: TheGoose;647206
Eeewww, so you are actually running a string replace on the actual vbulletin code that is suspect, why not just fix it at the source then patching it at run time?

Did you read the post?
 

Offline TheGoose

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1458
  • Country: us
  • Gender: Male
    • Show only replies by TheGoose
    • http://www.amiga.org/forums/blog.php?u=827
Re: The site is very slow...
« Reply #95 on: June 26, 2011, 08:33:14 PM »
Quote from: Piru;647208
Did you read the post?


Maybe a little overlap there.  :smack:
G1200, A3000D, A1200 PPC AOS4.0C

I\'m on Google +
 

Offline redfox

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 880
  • Country: ca
    • Show only replies by redfox
Re: The site is very slow...
« Reply #96 on: June 26, 2011, 08:56:45 PM »
Intermittant stalls when loading main page or moving around the website.

Just a moment ago, when I was trying to reply to this thread, I got a message saying the web page failed to load.

Loading http://www.amiga.org/forums/newreply.php?

OK when I tried again.

---
redfox
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: The site is very slow...
« Reply #97 on: June 26, 2011, 09:10:17 PM »
I just now got the following error:

Internal Server Error

 The server encountered an internal error or misconfiguration and was unable to complete your request.
 Please contact the server administrator,  webmaster@amiga.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.
 More information about this error may be available in the server error log.
 Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
  Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.amiga.org Port 80
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline Duce

  • Off to greener pastures
  • Hero Member
  • *****
  • Join Date: Jul 2009
  • Posts: 1699
    • Show only replies by Duce
    • http://amigabbs.blogspot.com/
Re: The site is very slow...
« Reply #98 on: June 26, 2011, 09:10:34 PM »
Aye, still stalling out.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: The site is very slow...
« Reply #99 on: June 26, 2011, 11:49:08 PM »
Quote from: ChaosLord;647220
I just now got the following error:

Internal Server Error

 The server encountered an internal error or misconfiguration and was unable to complete your request.
 Please contact the server administrator,  webmaster@amiga.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.
 More information about this error may be available in the server error log.
 Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
  Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.amiga.org Port 80


What exactly where you trying to view when this happened?
int p; // A
 

Offline Kesa

  • Ninja Fruit Slasher
  • Hero Member
  • *****
  • Join Date: Sep 2010
  • Posts: 2408
    • Show only replies by Kesa
Re: The site is very slow...
« Reply #100 on: June 27, 2011, 01:18:36 AM »
Quote from: Karlos;647237
What exactly where you trying to view when this happened?

If you see my post i made yesterday you will see the screenshots i tried to put up. Basically i tried to load the home page
Even my cat doesn\'t like me.
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: The site is very slow...
« Reply #101 on: June 27, 2011, 04:53:04 AM »
Quote from: Karlos;647237
What exactly where you trying to view when this happened?
I can't say for a guaranteed fact as I was in a hurry when it happened.  I will pay more attention next time.

I believe I had hit the back button which took me to an old New Posts page.  Then I pressed the reload button in Firefox.  This gave the error.

btw: I think you should modify the ErrorMsg() function to print the URL of the page that generated the error.  Don't u think that is a good idea?
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline zipper

Re: The site is very slow...
« Reply #102 on: June 27, 2011, 09:49:13 AM »
No error messages but a massive slowdown, took ages to load 4 tabs.
 

Offline gazgod

  • Sr. Member
  • ****
  • Join Date: Sep 2005
  • Posts: 282
    • Show only replies by gazgod
    • http://www.lincsamiga.org.uk
Re: The site is very slow...
« Reply #103 on: June 27, 2011, 01:12:32 PM »
Just got a 500 error whilst going into opening several threads in tabs, the following was at the bottom of the page:-

Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.amiga.org Port 80

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: The site is very slow...
« Reply #104 on: June 27, 2011, 01:18:11 PM »
@Karlos

There's ton of AJAX request being sent by a.org when you're not logged in: two per second, and they're all 404. Can't be good.
Code: [Select]
http://www.amiga.org/ajax.php?do=createad&adcode=header&setting=header&securitytoken=guest
http://www.amiga.org/ajax.php?do=createad&adcode=footer&setting=footer&securitytoken=guest

POSTDATA:
undefined&securitytoken=guest&s=