DEV Community

Bagisto dev
Bagisto dev

Posted on

A Critical Security Concern in Bagisto: Silent Admin Account Replacement & Deletion - Bagisto backdoor

Why This Matters

E-commerce platforms sit at the core of business operations. When an admin account can be silently deleted or replaced without the owner’s consent, the entire system’s integrity is compromised.

This article documents a serious security issue observed in Bagisto-based systems, where legitimate administrator accounts were removed and replaced by an unexpected default/admin user, without clear audit trails or user-initiated actions.

The goal of this article is awareness and responsible disclosure, not speculation.

🧩 What Happened

In a production Bagisto installation, the following behavior was observed:

A legitimate administrator account (for example, Admin ID = 1)
was overwritten and deleted.

Shortly afterward, a different admin account appeared, using:

a different email

a different username

but with equal or higher privileges

This occurred without any intentional action by the system owner

No admin UI interaction triggered the change

No standard Laravel or Bagisto logs explained why this happened

In practice:

A real administrator disappeared, and another administrator took its place.

🔍 What the Logs Revealed

  1. Database-Level Deletion Was Confirmed

Using MySQL binary logs (binlog) with ROW format enabled:

A DELETE operation was recorded on the admins table

The transaction was committed

This confirms the record was physically removed at the database level

This was not:

a soft delete

a UI hide

a permission change

  1. Application Logs Were Inconclusive

Laravel and Bagisto application logs:

Did not record an admin delete action

Did not identify a user, route, or controller responsible

  1. Prepared Statements Hide the Actor

Because Bagisto uses prepared statements, MySQL general logs show only:

Prepare
Execute
?

This obscures:

the origin of the query

whether it came from UI, background job, installer, or internal service logic

🔐 Important: This Was NOT Caused by Poor Server Security

To be absolutely clear, the environment was locked down:

✅ MySQL Security

❌ No remote MySQL access

❌ Root MySQL user disabled

❌ MySQL accessible only locally

❌ No shared credentials

❌ No external database connections

✅ SSH Security

❌ Password login disabled

✅ SSH key authentication only

❌ No public SSH access with credentials

❌ No unauthorized SSH sessions detected

✅ Infrastructure Controls

No exposed admin tools

No public database ports

No leaked credentials

This rules out:

brute-force attacks

remote MySQL compromise

SSH credential abuse

direct database manipulation by an external actor

🚨 The Most Concerning Behavior: Admin Replacement

The most alarming behavior was not just deletion — but replacement.

Observed pattern:

Legitimate admin account exists (ID ≈ 1)

That account is deleted

A different admin account appears

The new account has:

admin privileges

no clear creation event

no corresponding UI action

Over time, the legitimate admin is replaced again

This behavior is not normal for:

Laravel

Bagisto

or any standard RBAC implementation

❓ Why This Is a Serious Security Risk

  1. Breaks the Trust Model

Admin accounts are the root of trust.
Silent deletion or replacement invalidates all access assumptions.

  1. Impossible to Audit Retroactively

Without:

admin activity logs

immutable audit trails

database-level triggers

…post-incident investigation becomes guesswork.

  1. Potential Exploitation Vector

Whether intentional or accidental, this behavior can be exploited by:

malicious packages

compromised update logic

installer or seeder code

undocumented internal processes

⚠️ Is This a Backdoor?

This article does not claim intent.

However, from a security engineering standpoint, the observed behavior matches characteristics of a backdoor-like vulnerability:

Hidden privilege changes

No user interaction

No explicit audit trail

Repeated admin replacement

Privileged access granted implicitly

At minimum, this is a critical security flaw that requires investigation.

🛠️ What Bagisto Users Should Do Immediately

If you operate Bagisto in production:

Audit the admins table

Look for deleted, replaced, or recreated accounts

Enable database auditing

Log all DELETE, INSERT, UPDATE operations on admin tables

Force 2FA on admin access

Password-only admin access is insufficient

Retain MySQL binary logs

Long enough to investigate incidents

Review installers, seeders, and packages

Especially anything that touches admin users

📣 A Call to the Bagisto Community

Bagisto is widely adopted, which makes security transparency critical.

The community deserves:

acknowledgment of the issue

reproducible investigation

and a verified mitigation or fix

Ignoring this behavior puts real businesses at risk.

✅ Final Thoughts

This article is not an accusation.
It is a technical warning based on real production behavior.

When:

SSH is locked down

MySQL is not remotely accessible

root access is disabled

…and admin accounts are still silently deleted or replaced,
the problem is inside the application layer.

Bagisto users should verify their systems now, not after damage occurs.

Top comments (1)

Collapse
 
pathaksaurav profile image
Saurav Pathak

This has been taken care of with the patch release of v2.3.10: github.com/bagisto/bagisto/securit...