Why a PrestaShop shop is a target
An online shop concentrates everything attackers are looking for: personal data, order history and a payment journey. For a merchant selling in CHF, customer trust is also fragile: a single public incident can cost more than months of maintenance.
Attacks rarely target one particular shop. They are automated: bots crawl the internet looking for an old version, a module with a known flaw or weak access. Your shop is not chosen, it is found in a list.
What hackers are after
- Stealing customer data: names, addresses, emails, purchase history.
- Copying bank cards by injecting a script into the payment page.
- Using your server to send spam or host fraudulent pages.
- Hijacking your search rankings with thousands of indexed spam pages.
- Encrypting or destroying data to demand a ransom.
Where the flaw really lies
The PrestaShop core is watched by a large community and fixed quickly. Incidents far more often come from everything you have installed on top: an abandoned module, a theme that was never updated, a reused password or a core version that is no longer maintained. Hence a simple principle: a shop’s security is that of its weakest link.
Choosing and maintaining the right version
The core version determines the baseline level of protection. Here is where the current branches stand:
| Version | Situation | Risk level | Our recommendation |
|---|---|---|---|
| PrestaShop 1.7 | No more official security fixes | High, and rising over time | Plan the migration without delay |
| PrestaShop 8 | Maintained branch | Moderate if updates are applied | Stay up to date, prepare for what comes next |
| PrestaShop 9 | Most recent version | Lowest if maintained | Default choice for a new project |
Staying on an abandoned version is not a saving: every flaw discovered after support ends stays open, and the bots know about it. Our guide to migrating from PrestaShop 1.7 to version 8 or 9 details the steps, the module compatibility pitfalls and how to keep your data.
Applying an update safely
A security update is never applied directly in production. The proven method comes down to five steps:
- Back up the files and the database.
- Clone the shop to a test environment.
- Apply the update and test the key journeys: order, payment, emails, shipping.
- Fix any modules or theme that have become incompatible.
- Deploy to production outside peak traffic, then check.
Also keep an eye on the PHP version: a server running a PHP version that is no longer maintained exposes the shop, even if PrestaShop is up to date.
Modules and theme: fewer, but better
Every module adds code, and therefore possible flaws. An average-sized shop easily has thirty to forty, several of which are no longer used. Tidying up is the cheapest security measure there is.
Reducing the attack surface
- Uninstall unused modules rather than just disabling them: the code stays on the server and can still be attacked.
- Remove installation folders, test files and old copies of the site.
- Turn off debug mode in production, which reveals valuable information about the server’s structure.
- Remove themes and languages you do not use.
Criteria for choosing a module
Before installing a module, check five points:
- the publisher is identifiable and responds to support requests;
- the latest update is recent and compatible with your version of PrestaShop;
- the module is used by many merchants;
- it asks only for the permissions it needs;
- it comes from an official source, never from a “free” copy of a paid module.
These pirated copies are one of the most common infection vectors: the malicious code is hidden inside from the start. For a very specific need, a custom-developed module can be safer than stacking three generic modules, provided it is written to professional standards and reviewed.
Tip: take stock of your modules once a quarter. For each one, ask yourself: “If I remove it, what does the shop lose?” If the answer is “nothing”, uninstall it.
Hardening access
A weak or reused password remains the easiest way in. Hardening access costs little and blocks a large share of attempts.
The back office
- An admin folder with an unpredictable name (PrestaShop generates one at installation) and, where possible, access restricted by IP address.
- Two-factor authentication for all administrator accounts.
- Long, unique passwords, managed in a password manager.
- A limit on login attempts to slow down brute-force attacks.
- HTTPS everywhere, with automatic redirection and a certificate that renews without intervention.
The server and the database
- Separate accounts for hosting, the database and file access.
- Strict file permissions: the server must not be able to write everywhere.
- SSH access by key rather than by password, and SFTP instead of FTP.
- A web application firewall upstream to filter the most common malicious requests.
Team accounts
Each person has their own account, with the minimum rights needed. A visiting contractor receives time-limited access, removed at the end of the assignment. A former colleague whose account is still active is a classic cause of incidents.
Protecting the checkout
The payment page is the most sensitive page in the shop. “Skimming” attacks consist of slipping a few lines of JavaScript onto it that copy card data as it is entered, without either the shop or the customer noticing anything.
Good practices
- Use a provider whose card entry takes place in a field or page hosted by the provider: the data never passes through your server.
- Monitor the integrity of the files on the checkout page and the list of external scripts it loads.
- Limit third-party scripts on the checkout: analytics tools, widgets and pixels have no place on the payment page without good reason.
- Apply a content security policy (CSP) that allows only the intended sources.
- Keep your providers’ official payment modules up to date.
Swiss payments
TWINT, PostFinance, cards, QR-bill: each payment method has its own API keys, notification callbacks and generated files. Store the keys outside publicly accessible code, change them after a departure or an incident, and protect access to PDF invoices, which contain personal data. The same care applies to carrier connections, such as Swiss Post, whose credentials can be used to generate labels. For details on each method, see our page on TWINT and payments.
Backups, hosting and monitoring
Even the best-protected shop can go down. What makes the difference is the time it takes to get back online and the amount of data lost.
Backing up properly
- A daily backup of the files and the database.
- At least one copy off the server and away from the host, ideally immutable.
- Retention over several weeks, because an infection can lie dormant before it is detected.
- A restore tested at least once a year, stopwatch in hand.
Hosting that helps
Suitable hosting isolates your shop from other sites, applies system patches and offers reliable backups. Cheap shared hosting shares the risk with dozens of poorly maintained sites. The selection criteria are detailed in our guide to choosing PrestaShop hosting.
Monitoring continuously
- Availability: an alert as soon as the shop stops responding.
- Files: an alert as soon as a core or module file changes.
- Logins: an alert on unusual administrator access (time, country, device).
- Search visibility: a regular check of Google Search Console, language by language.
This last point matters for multilingual shops in French, German and Italian: spam pages injected into a single language easily go unnoticed if you only check the main version.
Responding to a hack and complying with the nFADP
When an incident happens, panic wastes time. A procedure written in advance changes everything.
The eight steps, in order
- Isolate: put the shop into maintenance mode and cut off suspicious access.
- Keep a copy of the files and logs for analysis.
- Identify the flaw and the likely date of the intrusion.
- Restore a clean state from before the infection.
- Fix the cause: update, removal of the faulty module, hardening.
- Change all access credentials: back office, database, hosting, API keys.
- Check the checkout and redirects before reopening.
- Inform the people concerned and the authorities if the law requires it.
What the nFADP requires
The new Swiss Federal Act on Data Protection requires you to report to the Federal Data Protection and Information Commissioner any breach that presents a high risk to the people concerned, as soon as possible. It also requires you to be able to document what happened and the measures taken. If you sell to customers in the European Union, other rules may apply. Our page on the nFADP for an online shop details the merchant’s obligations: register, information, processors and incident reporting.
Tip: write a one-page sheet today with the useful contacts (host, payment provider, agency, person in charge) and the eight steps above. On the day of an incident, you will save precious hours.
A summary security plan
To stay on course, here are the measures ranked by frequency:
| Measure | Frequency | Main effect |
|---|---|---|
| Updates to the core, modules and theme | As soon as a fix is released | Closes known flaws |
| Module inventory and clean-up | Every quarter | Reduces the attack surface |
| Review of accounts and rights | Every quarter | Prevents forgotten access |
| Restore test | Every year | Guarantees you can get back online |
| Monitoring of files and logins | Continuous | Detects an intrusion early |
| Checkout review | After every change | Protects your customers’ cards |
| Review of the incident procedure | Every year | Saves time on the day |
This plan also avoids the pitfalls described in our guide to common PrestaShop mistakes: abandoned modules, backups that were never tested, shared access. To keep it up over time without spending your evenings on it, our maintenance and hosting service takes care of tested updates, monitoring and backups.
Request a quote to secure your shop
A security audit starts with an assessment of where things stand: core version, list of modules, access, backups, checkout. You then receive a prioritised action plan, showing what is urgent, what can wait and what belongs to regular maintenance.
The budget varies according to the installed version, the number of modules and their condition, the level of theme customisation, the current hosting, the number of languages and the connected payment methods. You will find the principles of our approach on the pricing and method page.
Agence PrestaShop is the e-commerce brand of Prestasafe, an independent web agency with almost twenty years of experience. Nine experts carry out projects in-house, with no subcontracting: the person who audits your shop is the one who fixes it.
Your shop deserves real protection. Request your quote via the contact form by describing your version of PrestaShop, your main modules and your hosting: we will come back to you with a clear, detailed proposal.
Frequently asked questions
How do I know if my shop has been hacked?
Common signs are unknown files on the server, strange redirects, spam pages indexed by Google, a modified payment form or an alert from your host. Google Search Console also flags some security issues. If in doubt, have the integrity of your files checked before you carry on selling.
Are updates enough to protect my shop?
They are essential, but not sufficient. You also need to limit the number of modules, harden access, back up off the server and monitor. Security is a set of measures that complement each other, not a single setting.
Are free modules less safe than paid ones?
Not by nature. What matters is the publisher's reputation, how often the module is updated and how many shops actually use it. Be especially wary of copies of paid modules offered for free on third-party sites: they very often contain malicious code.
Is PrestaShop 1.7 still safe?
Older core versions no longer receive official fixes, which leaves flaws discovered afterwards unaddressed. Migrating to PrestaShop 8 or 9 is the only lasting way to get back onto a maintained foundation. It is prepared on a copy of the shop, without interrupting sales.
Do I need two-factor authentication for the back office?
Yes, it is one of the most cost-effective measures. A stolen or reused password is no longer enough to get into the administration. It can be installed in a few hours with a dedicated module and is complemented by staff accounts with limited rights.
Is my payment provider enough to secure payment?
It secures card processing, but not your page. A script injected into your checkout can copy the data before it reaches the provider. You therefore need to use fields or pages hosted by the provider and monitor the files and scripts on the payment page.
How often should a shop be backed up?
Every day for files and the database, and more often if you receive many orders. Copies must be kept off the production server. Above all, test a restore at least once a year: a backup that has never been restored is only an assumption.
What should I do if customer data is stolen?
Isolate the shop, identify the flaw, restore a clean state and change all access credentials. If the breach presents a high risk to the people concerned, the nFADP requires you to report the incident to the Federal Data Protection and Information Commissioner as soon as possible. Record every step so that you can justify it.
How much does it cost to secure a PrestaShop shop?
The budget depends on the installed version, the number of modules, the level of theme customisation, the hosting and the current state of the shop. An audit lets us put a precise figure on what is urgent and what can wait. The resulting quote is itemised, line by line.