Exposed Log File Lead to Full Internal path disclosure at [https://nextcloud.com/wp-content/debug.log]
A WordPress debug log file was publicly accessible at a predictable path, exposing internal file system paths and plugin details. An attacker could use this information to learn about the server's directory structure and installed plugins, potentially aiding further attacks.
- Triaged in 9 hours
- Fixed in 11 hours
- Disclosed after 37 days
Hi team , i found wp-content/debug.log endpoint public accessible That lead to full path disclosure
Steps : Open : https://nextcloud.com/wp-content/debug.log
You can See Internal paths disclosed and date is : 02-Nov-2022
[02-Nov-2022 08:50:36 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in █████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:139
Stack trace:
#0 ███████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(119): WPML\ST\MO\Hooks\LanguageSwitch->resetTranslationAvailabilityInformation()
#1 ███plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(73): WPML\ST\MO\Hooks\LanguageSwitch->changeMoObjects()
#2 ███plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(48): WPML\ST\MO\Hooks\LanguageSwitch->switchToLocale()
#3 ██████class-wp-hook.php(310): WPML\ST\MO\Hooks\LanguageSwitch->languageHasSwitched()
#4 ██████████class-wp-hook.php(332): WP_Hook->apply_filters()
#5 ██████plugin.php(517): WP_Hook->do_action()
#6 █████████plugins/sitepress-multilingual-cms/sitepress.class.php(1178): do_action()
#7 in █████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php on line 139
[02-Nov-2022 08:50:36 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in █████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:139
Stack trace:
#0 ████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(119): WPML\ST\MO\Hooks\LanguageSwitch->resetTranslationAvailabilityInformation()
#1 ██████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(73): WPML\ST\MO\Hooks\LanguageSwitch->changeMoObjects()
#2 ██████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(48): WPML\ST\MO\Hooks\LanguageSwitch->switchToLocale()
#3 ██████████class-wp-hook.php(310): WPML\ST\MO\Hooks\LanguageSwitch->languageHasSwitched()
#4 █████████class-wp-hook.php(332): WP_Hook->apply_filters()
#5 ███████plugin.php(517): WP_Hook->do_action()
#6 ████████plugins/sitepress-multilingual-cms/sitepress.class.php(1178): do_action()
#7 in ███plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php on line 139
[02-Nov-2022 08:50:36 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in ██████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:139
Stack trace:
#0 ████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(119): WPML\ST\MO\Hooks\LanguageSwitch->resetTranslationAvailabilityInformation()
#1 ████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(73): WPML\ST\MO\Hooks\LanguageSwitch->changeMoObjects()
#2 ██████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(48): WPML\ST\MO\Hooks\LanguageSwitch->switchToLocale()
#3 ████class-wp-hook.php(310): WPML\ST\MO\Hooks\LanguageSwitch->languageHasSwitched()
#4 ████████class-wp-hook.php(332): WP_Hook->apply_filters()
#5 ███████plugin.php(517): WP_Hook->do_action()
#6 ████plugins/sitepress-multilingual-cms/sitepress.class.php(1178): do_action()
#7 in ████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php on line 139
[02-Nov-2022 08:50:36 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in █████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:139
Stack trace:
Impact
Exposed Log file lead to exposed all internal paths
What the report shows
The target is the Nextcloud website, nextcloud.com, running WordPress. The researcher found that a WordPress debug log was publicly reachable at a predictable path under the WordPress content directory.
The single step in the report is to open the following URL:
https://nextcloud.com/wp-content/debug.log
The response was a PHP error log, and the researcher reports that it disclosed internal paths. The log entries are dated 02-Nov-2022. The excerpt shows repeated PHP fatal errors from a multilingual plugin stack, with the filesystem paths redacted in the published text:
[02-Nov-2022 08:50:36 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in █████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:139
Stack trace:
#0 ███████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(119): WPML\ST\MO\Hooks\LanguageSwitch->resetTranslationAvailabilityInformation()
#1 ███plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(73): WPML\ST\MO\Hooks\LanguageSwitch->changeMoObjects()
#2 ███plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(48): WPML\ST\MO\Hooks\LanguageSwitch->switchToLocale()
#3 ██████class-wp-hook.php(310): WPML\ST\MO\Hooks\LanguageSwitch->languageHasSwitched()
#4 ██████████class-wp-hook.php(332): WP_Hook->apply_filters()
#5 ██████plugin.php(517): WP_Hook->do_action()
#6 █████████plugins/sitepress-multilingual-cms/sitepress.class.php(1178): do_action()
#7 in █████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php on line 139
The same fatal error repeats several times in the excerpt, each with the same timestamp. The report's impact statement is short: the exposed log file leads to exposure of all internal paths. The platform records the report as low severity, weakness Information Disclosure, disclosed on 2022-12-15. No bounty amount is given.
Root cause
The log sits at wp-content/debug.log and was served as a static file, which is consistent with WordPress debug logging writing errors there. The log sits inside the document root, and nothing in the configuration blocked direct requests to it. The log itself records absolute filesystem paths in every stack trace, which is why a single readable file exposes the installation layout.
Impact
The report limits the impact to internal path disclosure. What the excerpt shows is the server's directory layout and the plugin file structure, plus the names of the plugins in use and the PHP error they were producing. Path disclosure on its own rarely allows direct compromise, but it removes guesswork for later attacks: an attacker learns where the installation lives, which plugins are present, and which code paths are failing. The report does not claim anything beyond path disclosure.
How this kind of bug works
Web applications write logs, and logs tend to contain absolute paths, stack traces, SQL fragments, request data and sometimes credentials or session identifiers. The danger appears when three things line up: the application writes the log inside a directory the web server serves, the file has a predictable name, and the server has no rule denying access to it. Static file serving does not care that the file is a log; if the path resolves and permissions allow reading, the content is returned.
WordPress is a common case because WP_DEBUG_LOG writes to wp-content/debug.log by default, and wp-content is normally web accessible. Similar exposure happens with error_log files created by PHP in the same directory as the failing script, framework logs under storage/logs, var/log, logs/, and backup or .env files left in the document root. The defences are straightforward: keep logs outside the document root, disable debug logging in production, and deny access to log-like paths at the web server or reverse proxy.
How to test for it
- Identify the stack. Response headers, cookie names, HTML comments, asset paths and error pages usually reveal WordPress, Laravel, Symfony, Django or a custom PHP application.
- Derive candidate log paths from the framework's defaults and from the site's own structure. For WordPress that means the debug log under the content directory; for other frameworks, the conventional log directories and file names.
- Request each candidate directly and inspect the status code, content type and body. A positive result is a
200with log-formatted text: timestamps, severity labels, stack traces, absolute paths or request details. - If a log is readable, check whether it is still being written by requesting it again later and comparing entries. A live log is more interesting than a stale one.
- Look for sensitive content in the entries: credentials, tokens, internal hostnames, SQL errors, user data. That is what turns path disclosure into a stronger finding.
Common false positives: a custom 404 page returned with status 200, an empty file, a directory listing without file contents, or a log that contains only generic messages with no paths or secrets. Confirm the body is genuinely log output before reporting.
How it is fixed
- Turn off debug logging in production and set the debug constant to false.
- Move log files outside the web root so they cannot be requested at all.
- Add web server rules that deny requests to log file extensions and known log paths, and return a plain 404 rather than a redirect.
- Remove existing log files from the document root and rotate logs to a protected location.
- As defence in depth, avoid printing absolute paths in production error output.
Hunting notes
This bug class hides wherever developers debug in place: WordPress wp-content, PHP error_log files next to entry scripts, framework log directories, and leftover files from staging or deployment. Recon signals include a WordPress site with plugin errors visible in responses, stack traces leaking in error pages, and directory listing enabled on content folders. Automated content discovery with a wordlist that includes log and debug file names finds many of these quickly, but manual reasoning about the framework's defaults is often faster.
To get a report accepted, show the exact URL, the response status and a redacted excerpt proving the file is a real log with internal paths or sensitive values. State clearly what the disclosure enables and avoid overclaiming: path disclosure is usually low severity, so tie it to concrete follow-on risk only where the log content supports it. If the log contains credentials or tokens, redact them in the report and note their presence, since that materially raises the impact.
What happened, in plain words
Nextcloud runs its public website on WordPress, a popular system for building websites. WordPress can be told to keep a diary of everything that goes wrong while it runs, and that diary is called a debug log. The researcher found that this diary was sitting at a web address anyone could open, with no password and no login needed.
The only step in the report is to visit this address in a browser:
https://nextcloud.com/wp-content/debug.log
That is a normal web address, so opening it is no different from opening any page. The important part is the ending, debug.log: it names a file rather than a page. The file was reachable at that address without any login. Think of a building where the reception desk is guarded, but the cleaner's cupboard is left unlocked in the corridor: nobody broke in, the door was simply open.
The file that came back was a list of PHP errors. PHP is the programming language WordPress is written in, and an error is what happens when the code tries to do something it cannot. The entries are dated 02-Nov-2022. Here is an excerpt, with the folder paths blacked out in the published version:
[02-Nov-2022 08:50:36 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in █████████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:139
Stack trace:
#0 ███████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(119): WPML\ST\MO\Hooks\LanguageSwitch->resetTranslationAvailabilityInformation()
#1 ███plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(73): WPML\ST\MO\Hooks\LanguageSwitch->changeMoObjects()
#2 ███plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(48): WPML\ST\MO\Hooks\LanguageSwitch->switchToLocale()
#3 ██████class-wp-hook.php(310): WPML\ST\MO\Hooks\LanguageSwitch->languageHasSwitched()
#4 ██████████class-wp-hook.php(332): WP_Hook->apply_filters()
#5 ██████plugin.php(517): WP_Hook->do_action()
#6 █████████plugins/sitepress-multilingual-cms/sitepress.class.php(1178): do_action()
#7 in █████plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php on line 139
Read it line by line. The date and time in square brackets say when the error happened. PHP Fatal error means the code stopped completely, not just warned. Uncaught Error: Call to undefined method says the code asked for a function that did not exist, a bit like calling a phone number that was never assigned. The rest of that line gives the file and line number where it happened. Stack trace is the trail of calls that led there, newest first: each numbered line shows which file and line called the next one, so you can follow the chain backwards to the starting point. The repeated entries with the same timestamp show the same failure recorded several times.
What makes this worth reporting is the paths. Every line contains the server's own folder structure, the names of the plugins installed (a plugin is an add-on that extends WordPress), and the exact files that were failing. The researcher's impact statement is one sentence: the exposed log file leads to exposure of all internal paths. The report does not claim anything beyond that. The platform records it as low severity, an information disclosure, disclosed on 2022-12-15.
Why does a list of folder names matter? On its own it does not let anyone break in. But it removes guesswork. Someone planning a later attack now knows where the site lives on the disk, which add-ons are installed, and which parts of the code are already misbehaving. It is like finding a floor plan of a building taped to the outside wall: the plan does not open any door, but it tells you exactly where the doors are.
In general, how this kind of bug works
Websites keep logs, and logs are full of detail: file paths, error trails, pieces of database queries, and sometimes passwords or session identifiers. A session identifier is the short code a site gives your browser after you log in so it recognises you on the next click; if someone else reads it, they can pretend to be you. The problem appears when three things line up at once:
- The site writes its log inside a folder the web server is allowed to hand out.
- The file has a name anyone can guess.
- The server has no rule refusing requests for it.
A web server does not know or care that a file is a log. If the address points at a real file and reading is permitted, the file is sent. WordPress is a frequent offender because its debug setting writes to wp-content/debug.log by default, and that folder is normally reachable from the web. The same thing happens with PHP error_log files dropped next to the script that failed, framework logs kept in folders such as storage/logs or var/log, and backup or configuration files left lying around.
The fixes are simple. Keep logs outside the folder the web server publishes. Switch debug logging off on a live site. Add server rules that refuse requests for log files and answer with a plain "not found" page.
If you ever go looking for this yourself, the approach is:
- Work out what the site is built with. Page addresses, cookie names and error pages usually give it away.
- Guess the log addresses from that system's usual defaults, and from the site's own folder names.
- Open each guess and look at what comes back. A real hit is a page of log text with timestamps, error levels and file paths.
- Open it again later. If new entries have appeared, the log is live, which is more interesting than an old one.
- Read the entries for anything sensitive: passwords, tokens, internal server names, user details. That is what turns a boring path list into a serious finding.
Watch for false alarms: a friendly "page not found" message dressed up as a normal page, an empty file, a folder listing with no file contents, or a log with only harmless messages. Check that the text really is log output before reporting it.
When reporting, give the exact address, what the server answered, and a redacted excerpt proving the file is genuine. Say what the disclosure allows and do not overstate it. Path disclosure is usually low severity, so only link it to a bigger risk when the log content actually supports that. If the log holds passwords or tokens, blank them out in the report but mention that they were there, because that changes the impact considerably.
Glossary
- WordPress: a widely used system for building and running websites, extended through add-ons called plugins.
- Plugin: an add-on that adds features to WordPress, such as multilingual support.
- PHP: the programming language WordPress and many websites are written in.
- Debug log: a file where a program records errors and warnings while it runs.
- Debug logging: the setting that tells a program to write those records to a file.
- Web server: the program that receives browser requests and sends back pages or files.
- Document root: the folder on the server whose contents the web server is allowed to publish.
- Static file: a file sent exactly as stored, without the server building a page around it.
- Request: the message a browser sends to a server asking for a page or file.
- Response: what the server sends back, including a status code and the content.
- Status code: a number saying how a request went, such as 200 for success or 404 for not found.
- Fatal error: an error that stops the code completely.
- Stack trace: the list of function calls that led to an error, newest first.
- Path: the location of a file or folder on the server's disk.
- Information disclosure: a bug where information that should stay private is exposed.
- Severity: a rating of how serious a bug is, here low.
- Session identifier: a short code a site gives your browser after login so it recognises you afterwards.
- Token: a piece of secret text used to prove identity or permission.
- Cookie: a small piece of data a site stores in your browser, often holding a session identifier.
- False positive: a result that looks like a bug but is not one.