Summary
Dokans Multi-Tenancy Based eCommerce Platform SaaS 3.9.2 exposes its Laravel .env configuration file to unauthenticated users via a direct request to /script/.env.
This disclosure leaks encryption keys, database and SMTP credentials, and other secrets, allowing attackers to forge session tokens, access all tenant data, and compromise the email infrastructure across the entire multi-tenant deployment.
Affected context
The vulnerability appears in deployments where the web server is misconfigured or the application design allows direct web access to framework configuration files such as .env.
In this context, Dokans' Laravel-based multi-tenant eCommerce platform exposes /script/.env over HTTP without access control.
The issue is most critical where:
- The
.envfile contains live APP_KEY, database, and SMTP credentials - The same infrastructure hosts multiple tenants
- Secrets are reused across services or long-lived without rotation
Exploit preconditions
- Attack surface: Public HTTP(S) interface of the Dokans platform
- Required access: None; exploitation is unauthenticated and remote
- Trigger point: A direct GET request to the
/script/.envpath - Why exploitation is possible: The environment configuration file, intended for server-side use only, is served as a static resource without authentication or path restriction, exposing sensitive secrets that underpin authentication and data separation.
Why this happens
At its core, this issue stems from treating a highly sensitive configuration artifact (.env) as if it were a safe, web-accessible file.
Laravel .env files typically store cryptographic keys (APP_KEY), database credentials, mail provider API keys, and other secrets that must never be exposed over HTTP.
By failing to enforce access control on the /script/.env path and/or failing to prevent the framework configuration directory from being web-accessible, the application allows unauthenticated disclosure of these secrets.
This maps conceptually to broken authentication and authorization controls (here represented by CWE-287) because the secrets leaked can be used to bypass normal authentication by forging session data and directly impersonating users and tenants.
Potential impact
- Attackers can forge session tokens or other encrypted state using the leaked APP_KEY and bypass normal authentication controls.
- Direct database access to all tenant data using exposed credentials, enabling data theft, modification, or deletion.
- Full compromise of the email infrastructure (SMTP/SendGrid), including sending phishing campaigns or intercepting password reset flows.
- Takeover of administrative accounts and control over tenant storefronts and configuration.
- Cross-tenant data exposure and loss of isolation in the multi-tenancy environment.
- Long-term persistence due to compromised secrets that may be reused across environments or services.
General mitigation guidance
Effective mitigation focuses on strictly separating sensitive configuration from the web-accessible surface and hardening secret management.
Common defensive patterns include:
- Ensuring environment and configuration files (such as
.env) are stored outside of the web root and never served by the web server. - Applying default-deny access controls for configuration and script directories, explicitly disallowing HTTP access to framework internals.
- Using centralized secret management solutions (e.g., environment variables or secret stores) instead of flat files in web-accessible paths.
- Implementing multi-tenant isolation best practices so that a compromise of one configuration element cannot trivially expose all tenants.
- Practicing regular secret rotation so that any accidental disclosure has limited impact and duration.
How teams detect issues like this
Organizations can detect this class of issue through a combination of configuration review, automated scanning, and monitoring:
- Web server configuration audits to identify exposure of
.env,.git, backup archives, or other sensitive files. - Automated DAST tools or security scanners configured to probe for common secret-bearing paths (e.g.,
/.env,/script/.env, backup files). - Static reviews of deployment scripts and Docker images to ensure configuration files are not copied into public document roots.
- Log monitoring for suspicious access to configuration-like endpoints, such as repeated requests to
.envor internal script directories. - Security policy enforcement in CI/CD to block deployments that include sensitive files in build artifacts destined for public directories.

