OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



FATAL Error: Cannot redeclare PxS5d()

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

FATAL Error: Cannot redeclare PxS5d()

Postby hamsavijay » Fri Nov 01, 2013 1:40 pm

We are running OJS 2.4.2 and we have numerous errors reported by our users. The error was originally started with
---
Fatal error: Cannot redeclare PxS5d() (previously declared in /home/maftree/public_html/eja/plugins/generic
---

We've started tackling one by one and the root cause were noticed that all files named "index.php" within journal sub-folders were of different size than the original master copy on our desktop. We've started replacing "index.php" file one by one on server by copying from desktop folder structure through filezilla (our journal is running on a shared server!).

We did a quick search and found out there are so many "index.php" files in each directory. Can anyone please help us:
(1) What could be the reason that all the index.php files were of increased size than original file? We've spoken to our webhost provider and have informed us no changes to php or sql is done recently. Also, we've checked the master folder permission on the server and it was set to "755". Is it vulnerable for external users?

(2) Is there an alternative way to replace all the index.php files using different tools? One problem with bulk uploading of folders from desktop to server is that I've to re-apply all the patches one by one as we did earlier. If there are no alternatives, I was planning to wait for 2.4.3 release; but this will upset our readers.

Thanks for your reply.

Regards
Priya
hamsavijay
 
Posts: 18
Joined: Fri Jul 03, 2009 3:14 pm

Re: FATAL Error: Cannot redeclare PxS5d()

Postby asmecher » Fri Nov 01, 2013 2:10 pm

Hi Priya,

Unfortunately it's very likely that your installation has been hacked. If that's the case, then it's unsafe to trust any of the PHP code on your system; the safest thing to do is:
  • Determine the means of attack. Vulnerable file permissions are a common cause; find out what username your server runs PHP scripts under and see if those files were writable by that account. If so, until you can change permissions to something safe, don't bother trying to fix it. For web-based attacks (the most common case), you can often correlate the last modified dates of modified files against the server's access log to identify the attack request.
  • Use a standard tool like "diff" to compare everything in your installation to the stock version that should be there. This will identify both your own patches and the attacker code; ensure that all that's left is original code and your patches. (The recursive option to diff is useful for this.)
  • Once you're sure that you've closed the vulnerability, and you've cleaned all attack code out by comparing it comprehensively to the original release, put the site back online.
If your server runs mod_php, then all scripts on the server will run under a common user account (typically "apache"). If any scripts are writable by that account, a single vulnerability anywhere on the server (e.g. someone's unmaintained install of Drupal) will be sufficient to launch an automated attack. This is very common. For this reason, we recommend using FastCGI rather than mod_php and configuring it to run each application under a different user account.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: FATAL Error: Cannot redeclare PxS5d()

Postby hamsavijay » Fri Nov 01, 2013 2:47 pm

Alec,
Thanks for your quick reply.

Our hosting provider has restored the web files from a backup folder. All is working fine now. But, I would like to address your ideas on security/folder permissions to right level so that we may not end up to same situation again.

I've also forwarded your suggestion of using fastCGI instead of mod_php.

In terms of folder permissions, we are planning to revert back permission to 755 to only recommended directories as per the installation instructions STEP (2) -
* config.inc.php, * public, * cache

For the rest of folders and files the default permission was 644. But, we've changed these (&sub-directories to 755 during installation as we had some troubles).

Kindly clarify can we reset the folders other than STEP (2) of installation back to 644.

Thanks,
Priya
hamsavijay
 
Posts: 18
Joined: Fri Jul 03, 2009 3:14 pm

Re: FATAL Error: Cannot redeclare PxS5d()

Postby asmecher » Fri Nov 01, 2013 3:35 pm

Hi Priya,

The numeric permissions are only part of the challenge -- what user will the files be owned by, and what user will PHP run scripts as?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: alirezaaa, Yahoo [Bot] and 3 guests