Nextcloud Security Testing: Default Credentials, WebDAV Exposure, Path Traversal, and File Sharing Misconfiguration

Nextcloud is the most widely deployed self-hosted cloud storage and collaboration platform, used by enterprises, universities, and privacy-conscious organizations as an alternative to Google Drive and Dropbox. Its attack surface spans both authentication and file access: the /status.php endpoint reveals Nextcloud version and maintenance mode without authentication, enabling targeted CVE exploitation; instances with default admin/admin credentials or setup-phase passwords allow full administrative access; Nextcloud's WebDAV endpoint at /remote.php/dav/ allows authenticated file enumeration and bulk download using standard WebDAV clients and curl; public link sharing creates predictable 15-character alphanumeric share tokens at /s/{token} — while each individual token is not brute-forceable, disclosed tokens grant unauthenticated file access; external storage configurations pointing to sensitive server paths (local filesystem, SMB shares) can expose files outside the intended Nextcloud data directory; and Nextcloud apps extend the attack surface significantly — many third-party apps have had path traversal and authentication bypass vulnerabilities. This guide covers systematic Nextcloud security assessment.

Table of Contents

  1. Nextcloud Discovery and Version Fingerprinting
  2. Default Credential Testing
  3. WebDAV File Enumeration and Download
  4. Public Share Token Enumeration
  5. Nextcloud Security Hardening

Nextcloud Discovery and Version Fingerprinting

# Nextcloud version exposed without authentication at /status.php
curl -s "https://nextcloud.example.com/status.php" 2>/dev/null | \
  python3 -c "
import json,sys
d = json.load(sys.stdin)
print(f\"Nextcloud version: {d.get('version','?')}\")
print(f\"Version string: {d.get('versionstring','?')}\")
print(f\"Maintenance: {d.get('maintenance','?')}\")
print(f\"Edition: {d.get('edition','?')}\")
" 2>/dev/null

# Also check /ocs/v1.php/cloud/capabilities (version + capabilities without full auth)
curl -s "https://nextcloud.example.com/ocs/v1.php/cloud/capabilities?format=json" \
  -H "OCS-APIRequest: true" 2>/dev/null | \
  python3 -c "
import json,sys
d = json.load(sys.stdin)
caps = d.get('ocs',{}).get('data',{}).get('version',{})
print(f\"Version: {caps.get('string','?')} (major={caps.get('major','?')})\")
" 2>/dev/null

WebDAV File Enumeration and Download

# Nextcloud WebDAV endpoint — accessible to all authenticated users
# PROPFIND lists directory contents; GET downloads files

# Test authentication with credentials
USERNAME="admin"
PASSWORD="admin"  # or weak password
NEXTCLOUD_URL="https://nextcloud.example.com"

# List all files in root directory via WebDAV PROPFIND
curl -s -X PROPFIND \
  "${NEXTCLOUD_URL}/remote.php/dav/files/${USERNAME}/" \
  -u "${USERNAME}:${PASSWORD}" \
  -H "Depth: 1" \
  -H "Content-Type: application/xml" \
  -d '' \
  2>/dev/null | python3 -c "
import sys,re
content = sys.stdin.read()
# Extract file paths and sizes from WebDAV response
files = re.findall(r'([^<]+)', content)
sizes = re.findall(r'(\d+)', content)
print(f'Files found: {len(files)}')
for f, s in zip(files[:10], sizes[:10] + ['?']*(10-len(sizes))):
    print(f'  {f} ({s} bytes)')
" 2>/dev/null

# Check OCS API — list all users (admin only)
curl -s "${NEXTCLOUD_URL}/ocs/v1.php/cloud/users?format=json" \
  -u "${USERNAME}:${PASSWORD}" \
  -H "OCS-APIRequest: true" 2>/dev/null | \
  python3 -c "
import json,sys
d = json.load(sys.stdin)
users = d.get('ocs',{}).get('data',{}).get('users',[])
print(f'Users: {users[:20]}')
" 2>/dev/null

Nextcloud Security Hardening

Nextcloud Security Hardening Checklist:
Security TestMethodRisk
Version disclosure via /status.php without authenticationGET /status.php — returns version string enabling targeted CVE exploitation of known Nextcloud vulnerabilitiesMedium
Default admin/admin credentialsPOST /index.php/login with admin/admin — common in self-hosted deployments that skipped setup hardeningCritical
WebDAV file enumeration and bulk downloadPROPFIND /remote.php/dav/files/{user}/ — lists entire file tree; GET downloads any file; all with just credentialsHigh
Admin API user enumerationGET /ocs/v1.php/cloud/users with admin credentials — lists all Nextcloud usernames and account detailsHigh
Public share tokens granting unauthenticated file accessGET /s/{token} — any disclosed share token provides access without login; assess token disclosure in emails/linksHigh
External storage pointing to sensitive server pathsReview external storage configuration — local filesystem mounts can expose OS files outside Nextcloud data directoryHigh

Automate Nextcloud Security Testing

Ironimo tests Nextcloud deployments for version disclosure via the unauthenticated /status.php endpoint, default admin credentials enabling full administrative access and file system control, WebDAV endpoint accessible for bulk file enumeration and download with valid credentials, public share tokens in distributed URLs granting unauthenticated file access, external storage configurations pointing to sensitive server filesystem paths, admin API user enumeration listing all Nextcloud accounts, and missing brute-force protection allowing credential stuffing against the login endpoint.

Start free scan