508 Loop Detected

HTTP Status CodesServer (5xx)rarerStatus Code: 508Last updated: todayTested on:Google ChromeNode.js v20 LTSJune 2026

The server terminated an operation because it encountered an infinite loop.

508 Loop Detected Quick Fix⏱️ Est. Fix Time: 3 minutes

Usually happens because:

  • Circular symbolic directory references inside
  • Internal routing loops between server

🔍 Quick Checklist:

Meaning

The HTTP 508 Loop Detected WebDAV server error status code indicates that the server terminated an operation because it encountered an infinite loop while processing a request with 'Depth: infinity'.

Root Causes

  • Circular symbolic directory references inside WebDAV directories requested recursively.
  • Internal routing loops between server configurations.
CauseFrequency
Circular symbolic directory references inside⭐⭐⭐⭐⭐
Internal routing loops between server⭐⭐⭐⭐

Common Mistakes

  • Configuring symbol links pointing back to parent directories on WebDAV file servers.

How to Fix

1Audit symbolic folder references inside filesystem shares.
2Ensure server commands check folder traversal depths.

Framework-Specific Examples

Express router returning 508.

Express Example
app.get('/traverse', (req, res) => {
  res.status(508).send('Infinite loop detected in folder traversal.');
});

Server Configuration Examples

Preventing circular loop proxying.

Nginx Config
# Nginx tracks internal redirection limits returning 508 if exceeded

Prevention

  • Guard directories traversal algorithms using visited path caches.

Frequently Asked Questions (FAQ)

Q: What is the difference between 508 Loop Detected and 208 Already Reported?

208 is a successful response (2xx) returned inside a Multi-Status body to indicate a duplicate link was skipped. 508 is an error response (5xx) indicating the server aborted the entire operation because it hit an infinite loop.

Q: What header is used to request infinite directory traversal?

WebDAV clients send the 'Depth: infinity' request header, which tells the server to recursively traverse all subfolders.

Q: Is 508 cacheable?

No. The 508 Loop Detected status code is never cached.

Q: How do servers detect loops?

By keeping a registry of filesystem node IDs (inodes) traversed during the request and checking if any ID is encountered twice.

Still having this problem?

Didn't solve your problem?

SuggestRequest Error