Forum

Thread tagged as: Problem

One of our Perch installs appears to have been hacked...

Guys,

Every time we log in to the Perch backend we are faced with new entries as per the attached screenshot any ideas what we can do to fix this?

Screenshot

TIA

Lee

Lee Stoker

Lee Stoker 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version are you running?

2.6.6 but this happened a while back and upgrading hasn't fixed it previously.

Simon Clay

Simon Clay 127 points

I've had this issue too. Like you, I had different translations.

It seemed a bot visited the site putting different query strings at the end of the url, causing Perch to think there was a new region created.

Drew McLellan

Drew McLellan 2638 points
Perch Support

The site's not been hacked - it just looks like you could do to tighten up the code for selecting a language.

What code do you currently have in your page for this?

It's been such a long time since we built this, I'm not sure how it all works anymore! However, this is the important bit (I think!)...

<?php
    session_start();
    if (isset($_GET['lang']) && $_GET['lang']!='') {
        $lang = $_GET['lang'];
        $_SESSION['lang'] = $lang;
    }elseif (isset($_SESSION['lang'])){
        $lang = $_SESSION['lang'];
    }else{
        // default language
        $lang = 'en';
    }
?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

I'd suggest using the example from here: https://solutions.grabaperch.com/architecture/how-do-i-create-a-multilingual-site

It names the languages specifically rather than taking whatever is given.