Skip to content
Info disclosure Write-up Beginner

Exposed Django Debug Mode on a Development Subdomain

A development subdomain had Django debug mode enabled, so any request to a non-existent path returned a detailed error page. An attacker could read environment variables, configuration details, internal file paths and framework versions from that page.

medium.com

Published on medium.com

Information Disclosure

MaMad, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

The target was a web application belonging to a company whose subdomains the researcher was enumerating during reconnaissance. The report does not name the company or the program. One of the production hosts seen was visionhub.redacted.com, and the finding concerns its development counterpart, visionhub-dev.redacted.com, which ran a Django application.

Django is a Python web framework. When DEBUG = True is set, Django returns detailed error pages for unhandled exceptions instead of a generic error response. Those pages are meant for developers working locally and are not intended to be reachable from the internet.

Setup

No accounts, roles or credentials were involved. The work was manual reconnaissance plus a technology check:

  • A web browser for browsing the subdomains and triggering the error page.
  • Wappalyzer, used to confirm the framework after the researcher had already recognised Django from the application's behaviour.
  • Prior experience with Django, which is what made the behaviour recognisable.

The only precondition was that the development subdomain be publicly reachable, which it was.

Finding it

While enumerating subdomains, the researcher noticed a consistent naming convention: several services had a production host and a matching host with a -dev suffix. The hosts listed in the report were:

Text
app.redacted.comapp-dev.redacted.comblog.redacted.comblog-dev.redacted.comadmin.redacted.comadmin-dev.redacted.comforum.redacted.comforum-dev.redacted.comvisionhub.redacted.com

(The list is reproduced as it appears in the report; the hostnames run together on one line.)

The -dev pattern stood out because development environments are often configured differently from production. One of the production assets was:

Text
visionhub.redacted.com

Since the other services had a corresponding development host, the researcher manually tried the same convention:

Text
visionhub-dev.redacted.com

The subdomain was accessible, so it was worth investigating further. The application's behaviour suggested Django, and Wappalyzer confirmed the stack.

Exploitation

Step 1: request a path that does not exist

The researcher appended an arbitrary string to the development host's URL:

Text
visionhub-dev.redacted.com/any_random_string

Any random string works here; the point is to reach a URL that the application does not route, so that Django raises an exception rather than serving a normal page.

Step 2: read the error page

Instead of a generic error, the application returned a detailed Django error page. That response is the confirmation that Django Debug Mode was enabled on this host.

From the original on medium.com

Steps to reproduce

The report gives the reproduction as follows:

  1. Open a web browser.
  2. Navigate to: https://visionhub-dev.cbre.com/<random-path>
  3. The server responds with a Django Debug error page, confirming that DEBUG = True is enabled.

Note that the reproduction step in the report spells the host with the company domain rather than the redacted placeholder used elsewhere.

Root cause

The development deployment was running with Django's debug setting enabled, so unhandled exceptions produced the full technical error page. The report does not describe how the environment was provisioned or why the setting differed from production; it only establishes that DEBUG = True was in effect on the publicly reachable host.

The reason this was reachable at all is the exposure of the development environment itself: the host followed a predictable naming convention and answered requests from the internet. The development host answered requests from the internet, so an outside user could reach it and trigger an error.

Impact

According to the report, Django Debug Mode can expose sensitive application details, including:

  • Environment variables
  • Application configuration details
  • Internal file paths
  • Framework/library versions

The impact is therefore stated in terms of what such a page can disclose. The exposure is conditional on the debug page being reachable, which in this case required only a request to a non-existent path on the development host.

Fix

The setting that caused the finding is Django's debug flag, which should be off in any environment reachable from outside, and the development host should not be publicly accessible in the first place.

Variants to test

  • Apply the naming convention to every production host. For each host found during enumeration, try the -dev (and similar) variants.
  • Trigger an unhandled exception on any suspected Django host. Request a path that does not exist, as in the report.
  • Check other frameworks' debug pages the same way.
  • Look at the relationships between assets, not just the count. The report's own takeaway is to understand how hosts relate to each other: a production host implies a development host, and the development host may be configured differently.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

A security researcher was looking around the internet-facing parts of a company's website, the way you might walk around a building and try the doors. Companies often run more than one version of a website: the normal one that customers use, and a separate copy used by the people building it. That separate copy is called a development environment, or dev environment for short. It is a bit like a rehearsal room next to the main stage: same play, but the people inside are still practising, the lights are brighter, and the notes are left lying around.

The researcher noticed that the company's websites followed a simple naming habit. If the normal site was called something, the practice copy was called something-dev. That is a very guessable pattern. He picked one normal site, guessed the name of its practice copy, and found it was accessible.

That practice copy was built with a tool called Django. Django is a piece of software that helps programmers build websites in the Python programming language. Django has a special setting called debug mode. When debug mode is on, Django is very talkative: if something goes wrong, instead of a polite "page not found" message, it shows a long, detailed page explaining exactly what broke, where the code lives, and how the site is set up. That is helpful when you are building the site on your own laptop. It is not something you want a stranger on the internet to see.

The researcher asked the practice site for a page that does not exist. The site answered with one of those long, detailed Django error pages. That confirmed debug mode was switched on, and that the page was visible to anyone. The report calls this kind of problem information disclosure: the site is not letting an attacker break in, but it is handing out information that should stay private.

From the original on medium.com

The background you need

Before walking through the steps, here are the ideas the report relies on, explained from scratch.

What a subdomain is

A domain name is the address you type to reach a website, like example.com. A subdomain is a prefix added in front of it, like blog.example.com or admin.example.com. Think of the main domain as a large office building and subdomains as the different departments inside it: reception, accounts, the post room. Each department can have its own door, its own staff and its own rules.

Companies use subdomains to keep different services apart. One subdomain might be the public website, another the blog, another the internal admin panel, another a forum. Each one is a separate address on the internet, and each one can be configured differently.

What a development environment is

When programmers build a website, they do not usually work directly on the live site that customers use. They keep a separate copy where they can experiment, break things and fix them without affecting real users. That copy is the development environment. The live site is called production.

Development environments are often set up more loosely than production: extra logging, test data, and settings that make life easier for the developers. That is fine as long as the development environment stays private. The problem starts when it is reachable from the ordinary internet, because then anyone can see those loose settings.

What Django is

Django is a framework: a collection of ready-made tools that programmers use to build websites faster. It is written for the Python programming language. Many well-known sites use it. You do not need to know Python to follow this report; you only need to know that Django is the engine underneath the site in question.

What debug mode is

Every piece of software has a way of reporting errors. A well-behaved public website says something vague like "something went wrong, please try again", because detailed errors can reveal how the site is built. A website in debug mode does the opposite: it shows the full technical story, including the exact line of code that failed, the settings in use, and the paths of files on the server.

Django controls this with a setting called DEBUG. When DEBUG = True, Django shows the detailed error page. When DEBUG = False, it shows a generic error. The setting is meant to be True only on a developer's own machine, and False on anything the public can reach.

What information disclosure means

Information disclosure is a category of security problem where a system reveals something it should keep to itself. It is not the same as someone stealing a password or taking over an account. It is more like a shop leaving its delivery schedule and staff rota taped to the front window: nothing is stolen, but a burglar now knows when the shop is empty and who has keys. On its own it may look minor; combined with other knowledge, it can help an attacker plan.

What reconnaissance means

Reconnaissance is the first phase of any security test: gathering information before trying anything. In website terms it means finding out which addresses exist, what software they run, and how they relate to each other. It is the online equivalent of walking around a building and noting the doors, the signs and the cameras before deciding what to try.

What Wappalyzer is

Wappalyzer is a browser extension. While you browse a website, it looks at clues in the pages and the responses and tries to guess which technologies the site uses: which web server, which programming framework, which analytics tool. It is a convenience, not magic; it gives you a list of likely technologies. In this report it was used to confirm what the researcher had already suspected.

The setup

The report is clear that no accounts, passwords or special access were involved. This was not a case of logging in as someone and abusing a feature. It was manual browsing plus one technology check.

The tools were:

  • A normal web browser, used to visit the subdomains and to trigger the error page.
  • Wappalyzer, used to confirm the framework after the researcher had already recognised Django from how the application behaved.
  • The researcher's own prior experience with Django, which is what made the behaviour recognisable in the first place.

The only precondition was that the development subdomain could be reached from the public internet. It could.

Finding it

Step 1: notice the naming pattern

While listing the company's subdomains, the researcher saw that several services came in pairs: a normal host and a matching host with -dev on the end. The hosts listed in the report were:

Text
app.redacted.comapp-dev.redacted.comblog.redacted.comblog-dev.redacted.comadmin.redacted.comadmin-dev.redacted.comforum.redacted.comforum-dev.redacted.comvisionhub.redacted.com

Line by line, in plain words:

  • The block is a list of hostnames, reproduced exactly as it appears in the report, which is why they all run together on one line instead of one per line.
  • app.redacted.com and app-dev.redacted.com are a pair: the first is the normal application host, the second is its development counterpart.
  • blog.redacted.com and blog-dev.redacted.com are the same idea for the blog.
  • admin.redacted.com and admin-dev.redacted.com are the same idea for the admin area.
  • forum.redacted.com and forum-dev.redacted.com are the same idea for the forum.
  • visionhub.redacted.com appears on its own at the end, with no -dev partner shown in the list.
  • redacted.com is a placeholder: the real company domain has been removed from the public write-up, which is normal practice.

Why this step matters: the researcher was not just counting subdomains. He was looking at how they relate. Once you see that four services follow the pattern "normal name plus -dev", you have a rule you can apply to the fifth.

Step 2: pick a production host

One of the production assets was:

Text
visionhub.redacted.com

This is the normal, customer-facing address for a service called visionhub. It is the reference point: the researcher now knows a service exists under this name.

Step 3: guess the development host

Because the other services had a matching development host, the researcher manually tried the same convention on this one:

Text
visionhub-dev.redacted.com

Line by line:

  • visionhub is the service name taken from the production host.
  • -dev is the suffix the other services used for their development copies.
  • .redacted.com is the company domain, again replaced with a placeholder.

The subdomain was accessible, so it was worth investigating further. In other words, the guess was correct: there was a development copy at that address.

Why this step matters: this is the heart of the finding. The researcher used a naming habit and a bit of curiosity. He used a naming habit and a bit of curiosity. The report's own reflection is that the interesting part was not the Django error; it was noticing the subdomain pattern and asking whether the development environment might be configured differently from production.

Step 4: recognise the framework

The application's behaviour suggested Django, and Wappalyzer confirmed the stack. The researcher had worked with Django before, so the way the site responded looked familiar. Wappalyzer was the second opinion, not the discovery.

Why this step matters: knowing which framework you are looking at tells you which mistakes are worth testing for. Django's debug mode is a well-known one, so recognising Django points you straight at the next step.

Exploitation

Step 1: request a path that does not exist

The researcher appended an arbitrary string to the development host's URL:

Text
visionhub-dev.redacted.com/any_random_string

Line by line:

  • visionhub-dev.redacted.com is the development host found in the previous step.
  • /any_random_string is a path added to the end of the address. It is deliberately meaningless: no page on the site is called that.
  • The point is to reach a URL the application does not know how to handle, so that Django raises an error instead of serving a normal page.

Why this step matters: a website in normal mode answers an unknown address with a polite "not found" page. A website in debug mode answers with the full technical error page. So asking for a page that does not exist is a simple way to find out which mode the site is in. Any random string works; the exact text is irrelevant.

Step 2: read the error page

Instead of a generic error, the application returned a detailed Django error page. That response is the confirmation that Django Debug Mode was enabled on this host.

From the original on medium.com

The image shows the exposed Django debug page returned by the development subdomain.

Why this step matters: the error page is the evidence. It is the site itself returning a detailed Django error page. The report does not reproduce the contents of the page beyond confirming that it was a detailed Django debug page, and it does not show any specific secret being read from it.

Steps to reproduce

The report gives the reproduction as follows:

  1. Open a web browser.
  2. Navigate to: https://visionhub-dev.cbre.com/<random-path>
  3. The server responds with a Django Debug error page, confirming that DEBUG = True is enabled.

Line by line:

  • Step 1 needs nothing more than an ordinary browser. No tools, no login.
  • Step 2 is the address to visit. https:// means the secure, encrypted version of the web. visionhub-dev.cbre.com is the development host, spelled here with the company domain rather than the redacted placeholder used elsewhere in the report. <random-path> is a placeholder for any made-up path, such as the any_random_string used earlier.
  • Step 3 is the expected result: a detailed Django error page, which tells you the DEBUG setting is True.

Note that the reproduction step in the report spells the host with the company domain rather than the redacted placeholder used elsewhere. That is simply how the report presents it.

Root cause

The development deployment was running with Django's debug setting enabled, so unhandled exceptions produced the full technical error page. An unhandled exception is what happens when the software hits a situation it has no instructions for, such as a request for a page that does not exist; instead of dealing with it gracefully, it stops and reports the problem.

The report does not describe how the environment was provisioned or why the setting differed from production. It only establishes that DEBUG = True was in effect on the publicly reachable host.

The reason this was reachable at all is the exposure of the development environment itself: the host followed a predictable naming convention and answered requests from the internet. The development host answered requests from the internet, so an outside user could reach it and trigger an error.

Impact

According to the report, Django Debug Mode can expose sensitive application details, including:

  • Environment variables
  • Application configuration details
  • Internal file paths
  • Framework/library versions

What those mean in plain words:

  • Environment variables are settings the server passes to the application, often including connection details and sometimes secrets. Think of them as the notes pinned next to the office kettle.
  • Application configuration details describe how the site is set up: which database it talks to, which features are switched on, and so on.
  • Internal file paths are the folder locations on the server where the code lives. They tell an attacker how the machine is organised.
  • Framework/library versions are the exact versions of the software in use. Knowing a version lets someone look up whether that version has known bugs.

The impact is therefore stated in terms of what such a page can disclose. The exposure is conditional on the debug page being reachable, which in this case required only a request to a non-existent path on the development host. Unauthenticated simply means no login was needed.

Fix

The setting that caused the finding is Django's debug flag, which should be off in any environment reachable from outside, and the development host should not be publicly accessible in the first place. In everyday terms: turn off the talkative error mode, and keep the rehearsal room's door locked.

Variants to test

These are the general lessons the report draws out, written so you can apply them yourself.

  • Apply the naming convention to every production host. For each host found during enumeration, try the -dev (and similar) variants. In plain words: if you find shop.example.com, try shop-dev.example.com.
  • Trigger an unhandled exception on any suspected Django host. Request a path that does not exist, as in the report.
  • Check other frameworks' debug pages the same way. A stack trace is the list of function calls the software was in when it failed, which is exactly the kind of internal detail you do not want public.
  • Look at the relationships between assets, not just the count. The report's own takeaway is to understand how hosts relate to each other: a production host implies a development host, and the development host may be configured differently. The researcher's question, quoted in the report, was: "Could the development environment be configured differently from production?" That question is the whole method.

Glossary

  • Debug mode: a setting that makes software show detailed technical error pages instead of vague ones; useful locally, dangerous in public.
  • Development environment (dev environment): a separate copy of a website used by its builders to test changes, kept apart from the live site.
  • Django: a framework for building websites in the Python programming language.
  • Domain name: the address you type to reach a website, such as example.com.
  • Environment variables: settings passed to an application by the server, sometimes containing sensitive values.
  • Framework: a collection of ready-made tools that programmers use to build software faster.
  • Information disclosure: a security problem where a system reveals information it should keep private.
  • Production: the live version of a website that real users see.
  • Reconnaissance: the information-gathering phase of a security test, before any exploitation.
  • Stack trace: the list of function calls software was executing when it failed, often shown in detailed error pages.
  • Subdomain: a prefix added in front of a domain name to identify a separate service, such as blog.example.com.
  • Unauthenticated: done without logging in.
  • Unhandled exception: an error the software has no instructions for dealing with, so it stops and reports it.
  • Wappalyzer: a browser extension that guesses which technologies a website uses by inspecting its pages and responses.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.