Skip to content

Securing FOSSBilling

This page covers the application-level settings you should review after installation. Pair these with the broader infrastructure guidance in Best Practices.

Review these settings after installation. The Configuration File reference lists their defaults and syntax.

Keep the default security settings for production unless you have a specific compatibility issue. Enforce HTTPS, use strict session cookies, and enable fingerprint logging only while troubleshooting session problems.

Enable trusted proxy settings only for proxies you control. Confirm their addresses and forwarded header format so FOSSBilling can identify the visitor's IP and protocol.

Keep CSRF protection enabled for session-authenticated browser API calls. The bundled JavaScript API wrapper sends the token automatically. External API calls authenticated with an API key do not need a CSRF token.

Guest client login/signup, staff login, and cart mutations require a session-bound token and reject cross-origin browser requests even when api.CSRFPrevention is disabled. See the API reference for endpoint and token requirements.

Keep rate limiting enabled to protect login and other public endpoints. Limit exemptions to trusted integrations that need them. If you are upgrading from a version that used api.rate_* settings, see the rate limiter migration notes.

The Antispam module (replaces the old Spamchecker module) provides built-in spam protection including CAPTCHA, IP blocking, disposable email detection, Stop Forum Spam lookups, and honeypot fields. See Anti-Spam for setup and troubleshooting.

If you're using Cloudflare, enable IP Geolocation under your site's Network settings. This allows FOSSBilling to use the visitor's country information to strengthen some session checks.

FOSSBilling can detect when it is running behind a reverse proxy. If forwarded headers (such as X-Forwarded-For or Forwarded) are present during installation, the installer shows a proxy configuration step with:

  • The detected proxy IP address
  • Whether the address is private/local
  • The detected header format
  • A suggested public URL derived from the forwarded headers

You can enable trust in the installer or later in config.php under the security.trusted_proxies setting.

Reverse proxies often make FOSSBilling think it is being accessed over HTTP even when the visitor is using HTTPS. To avoid that, make sure your proxy forwards X-Forwarded-Proto: https.