S4E just found a low-severity finding from online aspnet version detection scanner
PlatformPlansPartners
Resources
ToolsBlogDocs
Sign Up →
medium·Misconfiguration·Updated May 27, 2026

Laravel Sanctum Csrf Security Misconfiguration Scanner

This scanner detects the use of Laravel Sanctum Security Misconfiguration in digital assets. The vulnerability can allow arbitrary external origins to make credentialed cross-origin requests due to a CSRF misconfiguration in the SANCTUM_STATEFUL_DOMAINS setting. Proper configuration can help mitigate unauthorized access and potential data breaches.

Est. Time~10 seconds
Scan TypeSingle Scan
Targetsdomain, subdomain, ipv4
CostFree
3.3k
Times Used
continuous scan runs
5.9k
Continuously Checked
assets under CS
0
Vulnerabilities Found
confirmed findings
References
Detail

Laravel Sanctum is widely used for securing single-page applications with token-based authentication. It allows developers to handle various user authentication needs while ensuring a smooth experience in creating APIs for their applications. Laravel Sanctum is often utilized by development teams to implement efficient SPA authentication using cookies for first-party applications. This token-based session authentication offers security for APIs and simplicity in managing user sessions. Under standard configurations, Sanctum ensures that first-party applications can interact with APIs securely.

The Security Misconfiguration vulnerability in Laravel Sanctum can occur when the SANCTUM_STATEFUL_DOMAINS is configured with wildcard or overly permissive values. This misconfiguration allows the issue of CORS headers that permit arbitrary external origins to execute credentialed cross-origin requests. The presence of this vulnerability provides unauthenticated remote attackers with the potential to exploit and make authenticated actions on behalf of logged-in users who visit malicious pages hosted by attackers.

The identified endpoint, /sanctum/csrf-cookie, might lead to Security Misconfiguration vulnerabilities when it grants XSRF-TOKEN cookies for requesting untrusted origins. The failure to properly configure SANCTUM_STATEFUL_DOMAINS along with improper session domain setting might arise from default or overlooked configurations. CORS headers set in a permissive manner allow uncontrolled domains to interact with Sanctum-protected APIs, creating a window for exploitation.

Exploitation of this vulnerability can cause significant damage, including unauthorized access to sensitive user data and malicious actions such as modification of account settings, or initiating financial transactions. The exploited application might facilitate Cross-Site Request Forgery (CSRF) attacks aimed at victims who access malicious pages specifically crafted to exploit this misconfiguration. Users and businesses might face severe repercussions, including data theft or unauthorized operations.

REFERENCES

Solution Advice
  • Restrict SANCTUM_STATEFUL_DOMAINS and SESSION_DOMAIN to only trusted application domains to ensure secure operation.
  • Configure session cookies with SameSite=Lax or SameSite=Strict to lessen unauthorized cross-site requests.
  • Ensure that the config/cors.php does not employ wildcard (*) origins especially when supports_credentials is enabled.
  • Review and limit CORS settings to trusted origins only for credentialed requests to avoid unauthorized access.
  • Regularly review security configurations to avoid vulnerabilities stemming from configuration oversites.

Get AI-powered remediation steps tailored to your asset.

Try AI Solutions →

Check your infrastructure.
Right now.

11,000+ scanners. Free to start. No credit card required.