<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Teuta Morina on Medium]]></title>
        <description><![CDATA[Stories by Teuta Morina on Medium]]></description>
        <link>https://medium.com/@teuta.morinaaa?source=rss-b89b31a41c73------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7Ji6hTAXpcv_4nWK</url>
            <title>Stories by Teuta Morina on Medium</title>
            <link>https://medium.com/@teuta.morinaaa?source=rss-b89b31a41c73------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:20:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@teuta.morinaaa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Hidden Dangers of Information Disclosure in Applications]]></title>
            <link>https://medium.com/@teuta.morinaaa/the-hidden-dangers-of-information-disclosure-in-applications-a079b0a0dddf?source=rss-b89b31a41c73------2</link>
            <guid isPermaLink="false">https://medium.com/p/a079b0a0dddf</guid>
            <dc:creator><![CDATA[Teuta Morina]]></dc:creator>
            <pubDate>Sat, 04 Oct 2025 10:11:07 GMT</pubDate>
            <atom:updated>2025-10-04T10:11:07.303Z</atom:updated>
            <content:encoded><![CDATA[<p>Information disclosure vulnerabilities are often underestimated within the cybersecurity community. Many dismiss them as low-risk oversights with minimal impact. However, when leveraged alongside other flaws or exploited strategically, even minor disclosures can serve as an entry point for full account takeovers.</p><p>Many security professionals overlook information disclosure vulnerabilities, assuming they pose minimal risk. However, seemingly harmless leaks such as error messages, API responses, developer comments or exposed configuration files can provide attackers with valuable insights into an application’s internal workings. These disclosures may reveal sensitive details like authentication mechanisms, internal endpoints, or debugging information that adversaries can leverage for more advanced attacks.</p><p>Along the way, we’ll explore how information disclosure led to the unintentional exposure of OAuth credentials, turning a simple oversight into a full account takeover.</p><p>Finally, we will cover practical steps to mitigate these risks, including sanitizing error messages, restricting file access, and controlling API responses to prevent sensitive data exposure.</p><p>If you want to protect your applications against these hidden threats, keep reading.</p><h3>Lazy Article Summary</h3><p><strong>Single API response leads to Account Takeover</strong></p><p>Exposing sensitive authentication credentials, such as OAuth client IDs and client secrets, can result in a severe security vulnerability. Imagine submitting a password reset request and unintentionally revealing these credentials — allowing an attacker to bypass authentication entirely, without needing to know a user’s password.</p><p>When exposed, OAuth credentials can enable attackers to generate access tokens and gain unauthorized access to accounts. This is particularly concerning in scenarios where sensitive authentication information is leaked via commonly used features, such as “Forgot Password.” This highlights the critical need to prevent unintentional exposure of sensitive information.</p><p><strong>Mitigation Recommendations</strong></p><p>To mitigate the risk of information disclosure, a proactive approach to secure coding practices is essential. Key measures include sanitizing error messages, restricting file access, and designing APIs to limit the exposure of sensitive information. Ensuring that debugging features are disabled in production environments, along with thorough audits of third-party technologies, further reduces the attack surface.</p><h3>What is Information Disclosure?</h3><p>Information disclosure, or information leakage occurs when an application unintentionally reveals sensitive information to unauthorized users; this could include valuable information about the system, application logic, or user data. While not always immediately exploitable, these leaks can provide attackers with critical pieces of the puzzle needed to compromise systems.</p><p>Common examples include:</p><ul><li><strong>Error messages</strong>: Detailed error messages, such as stack traces or database errors, can reveal information about the internal workings of the application or server, including database names, file paths, or even user credentials.</li><li><strong>File disclosure</strong>: An application might allow attackers to access files on the server (e.g., through directory listing, directory traversal attacks, etc). This could expose configuration files, backup files, or other sensitive data.</li><li><strong>HTTP response headers</strong>: Sometimes, HTTP response headers can contain unnecessary information, such as the server version, or software components, which may help attackers identify potential weaknesses.</li><li><strong>Developer comments</strong>: During development, in-line HTML comments are often added but may be forgotten or left in production unintentionally. Although not visible on the rendered page, they can be easily viewed using Burp or browser developer tools. These comments can reveal valuable information to attackers, such as hidden directories or application logic details.</li><li><strong>API responses</strong>: APIs frequently introduce information disclosure vulnerabilities by returning detailed responses that may expose sensitive data. Attackers can exploit these responses to gather insights into an application’s structure, user data, or internal systems. Such exposure increases security risks, including user enumeration, account takeovers, and privilege escalation.</li></ul><h3>What is the impact of information disclosure vulnerabilities?</h3><p>The impact of information disclosure vulnerabilities depends on the nature of the exposed data and how attackers can leverage it. In some cases, direct exposure of sensitive information — such as credentials, API keys, session tokens, or personally identifiable information (PII) — can lead to immediate security breaches. For example, if an application leaks user authentication tokens or database credentials, an attacker may gain unauthorized access, leading to account takeover, data exfiltration, or further exploitation of the system.</p><p>Even when the disclosed information does not appear sensitive on its own, it can still aid attackers in reconnaissance and exploitation. Exposing details such as server banners, debug error messages, internal IP addresses, or third-party dependencies can provide adversaries with a roadmap to identify and exploit weaknesses. For instance, knowledge of a specific framework version may allow attackers to target known vulnerabilities.</p><p>The severity of an information disclosure vulnerability is often contextual. A seemingly minor leak, when combined with other vulnerabilities, can escalate into a more critical issue. Attackers frequently chain multiple lower-severity weaknesses to compromise a system, making even small disclosures a potential security risk. Organizations should treat all unintended information exposure as a security concern and mitigate it through proper access controls, data sanitization, and security best practices.</p><h3>Real-World Example: Basecamp’s Information Disclosure vulnerability</h3><p>A relevant example of an information disclosure vulnerability can be found in the HackerOne <strong>Hacktivity</strong> platform, which documents vulnerabilities reported by security researchers. One such case involved <strong>Basecamp</strong>, where a hacker discovered an information disclosure flaw leading to the leakage of <strong>AWS access keys and user cookies</strong> via uninitialized memory leaks.</p><p>You can read the full breakdown of this incident here:<a href="https://www.hackerone.com/blog/how-information-disclosure-vulnerability-led-critical-data-exposure"> How Information Disclosure Vulnerability Led to Critical Data Exposure</a>.</p><p>I encountered a similar security issue during a security engagement a few years ago, where an unintentional leak of OAuth credentials could have led to account takeover. In this case, the flaw was found in the “Forgot Password” functionality of a mobile application, exposing client_id and client_secret through the response. Let’s dive into how this issue unfolded and its potential impact.</p><h3>Exploitation Example</h3><p>During a security engagement, we were assessing the “Forgot Password” functionality of a mobile application. Typically, applications return a generic message such as “<em>If email is registered, you will receive a password reset link.</em>” However, in this case, when I submitted a password reset request, the application responded with sensitive information: the client_id and client_secret, which are used for OAuth-based authorization.</p><p>These credentials are crucial for the OAuth flow and should never be exposed to end users. If an attacker gains access to these credentials, they can generate access tokens, potentially bypassing authentication mechanisms and taking over user accounts.</p><p>Here’s how the vulnerability unfolded:</p><h4>Step 1: Password Reset Request</h4><p>An attacker submits a password reset request for a valid user’s email address. The request should trigger a generic response confirming the action, but instead, the application leaks OAuth credentials of the user.</p><p><strong>Request</strong></p><pre>POST /api/v1/ForgotPassword HTTP/2<br>Host: example.com<br>Content-Type: application/json<br>{<br>&quot;device_ip&quot; : &quot;192.168.30.89&quot;,<br>&quot;email&quot;:&quot;pentester@mail.com&quot;,<br>&quot;device_browser&quot; : &quot;Mobile_App&quot;,<br>&quot;device_type&quot; : &quot;iOS&quot;,<br>}</pre><p><strong>Response</strong></p><p>Instead of a generic response, the application returned sensitive OAuth credentials client_id and client_secret in its response body. This is a significant information disclosure flaw.</p><pre>{<br>&quot;status&quot;:{<br>&quot;error&quot;:false,<br>&quot;code&quot;:200,<br>&quot;type&quot;:&quot;Success&quot;,<br>&quot;message&quot;:&quot;Success&quot;<br>},<br>&quot;account_number&quot;:&quot;21356753&quot;,<br>&quot;client_id&quot;:&quot;2110100_API_User&quot;,<br>&quot;client_secret&quot;:&quot;[redacted]&quot;,<br>&quot;email_id&quot;:&quot;pentester@mail.com&quot;<br>}</pre><p>In this case, the application is unintentionally exposing OAuth credentials for every valid email address that is submitted. An attacker could exploit this by simply issuing multiple password reset requests for different users, retrieving the client_id and client_secret of each user account.</p><p>But how this unintentional disclosed information can be abused, let’s see how and why an attacker is able to exploit the custom oAuth flow implementation in this case.</p><h4>Step 2: Authentication Flow</h4><p><strong>What is OAuth?</strong></p><p><a href="https://auth0.com/docs/authenticate/protocols/oauth">OAuth</a> itself is not an authentication protocol; it is an authorization framework. Its primary goal is to grant third-party applications limited access to user resources without exposing user credentials. While it’s sometimes used in “authentication-like” flows (especially when extended with OpenID Connect (OIDC) protocol), OAuth itself isn’t designed to validate a user’s identity.</p><p>Here’s how the authentication flow was implemented on the mobile application we were testing; it was a two‐step process that combines authentication (validating the user’s credentials) and authorization (issuing an OAuth access token) using the Resource Owner Password Credentials (ROPC) grant.</p><ol><li><strong>User authentication and oAuth credentials retrieval</strong></li></ol><p><strong>Request</strong></p><p>On the mobile application login page the user supplied email and password, see the request below:</p><pre>POST /api/v1/Login/Validate HTTP/1.1<br>Host: example.com<br>Content-Type: application/json<br>{<br>&quot;device_browser&quot; : &quot;Mobile_App&quot;,<br>&quot;device_type&quot; : &quot;iOS&quot;,<br>&quot;password&quot; : &quot;[redacted]&quot;,<br>&quot;email&quot; : &quot;pentester@mail.com&quot;,<br>&quot;device_ip&quot; : &quot;192.168.30.89&quot;<br>}</pre><p><strong>Response</strong></p><p>The server is <strong>not issuing an access token</strong>, it only validates user credentials and returns in the response user info along with <strong>client credentials (</strong>client_id and client_secret<strong>) </strong>that the system associates with that user, which the application later uses in OAuth.</p><pre>{<br>&quot;Status&quot;:{<br>&quot;error&quot;:false,<br>&quot;code&quot;:200,<br>&quot;type&quot;:&quot;Success&quot;,<br>&quot;message&quot;:&quot;Success&quot;<br>},<br>&quot;data&quot;:{<br>&quot;account_number&quot;:&quot;21356753&quot;,<br>&quot;first_name&quot;:&quot;User&quot;,<br>&quot;last_name&quot;:&quot;Pentest1&quot;,<br>&quot;photo&quot;:&quot;https://example.com/Participant/ProfilePhotoThumbnail/T_75_NoExtPhoto.jpg&quot;,<br>&quot;membertype_id&quot;:4,<br>&quot;account_status&quot;:&quot;&quot;,<br>&quot;mobile_number&quot;:&quot;&quot;,<br>&quot;terms&quot;:true,<br>&quot;terms_date&quot;:&quot;1/20/2021 2:18:00 PM&quot;,<br>&quot;terms_url&quot;:&quot;https://example.com/content/terms.pdf?v=373&quot;,<br>&quot;client_id&quot;:&quot;2110100_API_User&quot;,<br>&quot;client_secret&quot;:&quot;[redacted]&quot;<br>}<br>}</pre><p><strong>2. Requesting an OAuth access token</strong></p><p><strong>Request</strong></p><p>The application then uses these client credentials to request an access token from the OAuth token endpoint (/oAuth/token). This second step is where the ROPC flow takes place: the <strong>client_id</strong> and <strong>client_secret</strong> are used along with the <strong>grant_type=password</strong> to obtain an access token.</p><pre>POST /oAuth/token HTTP/2<br>Host: example.com<br>Content-Type: application/x-www-form-urlencoded<br><br>client_id=2110100_API_User&amp;client_secret=[redacted]&amp;grant_type=password</pre><p><strong>Response</strong></p><pre>{<br>&quot;access_token&quot;:&quot;[access token not included due to confidentiality.]&quot;,<br>&quot;token_type&quot;:&quot;bearer&quot;,<br>&quot;expires_in&quot;:86112,<br>&quot;refresh_token&quot;:&quot;[redacted]&quot;,<br>&quot;client_id&quot;:&quot;2110100_API_User&quot;,<br>&quot;.issued&quot;:&quot;Thu, 04 Aug 2022 09:12:13 GMT&quot;,<br>&quot;.expires&quot;:&quot;Fri, 05 Aug 2022 09:12:13 GMT&quot;<br>}</pre><p>Once the access token is issued, the user can use the token to view the protected resources or data they have been authorized to access, such as their profile information, account details, or other secured content.</p><p>We saw above that this was a custom implementation of OAuth ROPC grant. First, a request is made to /api/v1/Login/Validate with email, password, and device details. The server validates this, returning account info, along with client_id and client_secret. Then, using these user’s credentials, a POST request to /oAuth/token is made to exchange for an access token. For the typical ROPC grant please refer to this <a href="https://www.oauth.com/oauth2-servers/access-tokens/password-grant/">link</a>.</p><p><strong>But, why does each user on the mobile app have a client_id and client_secret?</strong></p><p>In OAuth, a client_id and client_secret are assigned to applications (clients), not individual users. The purpose of these credentials is to authenticate the client application when requesting access tokens from the OAuth server. However, in the custom implementation of this mobile application, the system assigns a unique client_id and client_secret per user. This practice not only deviates from the intended use of OAuth but also risks exposing sensitive information. For instance, if credentials are leaked it could lead to user impersonation as we have seen above, or other forms of abuse.</p><p>If you need more info for the client credentials, please refer here <a href="https://www.oauth.com/oauth2-servers/client-registration/client-id-secret/">link</a>.</p><p><strong>How do OAuth vulnerabilities arise?</strong></p><p>OAuth authentication vulnerabilities arise because the OAuth specification is intentionally vague and flexible. While there are a few required components for each grant type, most of the implementation is optional, including crucial security settings that protect user data. This opens the door for bad practices to slip in.</p><p>Another issue is that OAuth lacks built-in security features. It relies on developers to choose the right configurations and add their own security measures, such as proper input validation. As you can imagine, this can be tricky and easy to get wrong, especially for those new to OAuth.</p><h4>Step 3: Account Takeover</h4><p>With the access token in hand, the attacker can now fully bypass the password authentication mechanism, gaining access to the targeted user’s account. The attacker can retrieve personal account details, perform actions on behalf of the user, and potentially escalate privileges if other vulnerabilities exist.</p><p><strong>Request</strong></p><pre>GET /api/v1/GetUserAccountInfo HTTP/2<br>Host: example.com<br>Content-Type: application/json<br>Authentication: bearer [redacted]</pre><p><strong>Response</strong></p><pre>{<br>&quot;status&quot;:{<br>&quot;error&quot;:false,<br>&quot;code&quot;:200,<br>&quot;type&quot;:&quot;Success&quot;,<br>&quot;message&quot;:&quot;Success&quot;<br>},<br>&quot;data&quot;:{<br>&quot;name&quot;: &quot;User Pentester&quot;,<br>&quot;email_id&quot;:&quot;pentester@mail.com&quot;,<br>&quot;account_identity_level&quot;:&quot;Advanced&quot;<br>}<br>}</pre><p>As demonstrated, we gained access to the user’s personal account information, including account identity level, email, and potentially much more depending on the application’s functionality. This highlights how a simple information disclosure flaw can escalate into a full account takeover, which could have devastating consequences for the user and the organization.</p><h3>Mitigation Steps</h3><p>Completely preventing information disclosure is challenging due to the many ways it can occur. However, following certain best practices can help minimize the risk of these vulnerabilities in your applications.</p><ul><li><strong>Sanitize error messages</strong>: To minimize information leakage, avoid exposing internal details such as stack traces, database errors, or system file paths in error messages. Instead, provide generic error messages, such as “An error occurred. Please try again later.” Implement a centralized error-handling mechanism to ensure consistency in messaging.</li><li><strong>Secure API design</strong>: Design APIs to return only the essential data needed for the operation, and prevent the exposure of sensitive information such as oAuth credentials. Implement standardized API responses to minimize exposure to debugging or sensitive information.</li><li><strong>Restrict file access</strong>: Disable directory browsing on web servers to prevent attackers from viewing directory contents. Configure proper file permissions to limit access to sensitive files and ensure directories and files are only accessible by authorized users. Regularly audit these configurations to prevent unauthorized exposure.</li><li><strong>Disable debugging and diagnostic features in production</strong>: Ensure that debugging and diagnostic features are completely disabled in production environments. These features can provide attackers with detailed insights into your application, such as error messages or internal configurations, which can be exploited.</li><li><strong>Review third-party technologies</strong>:<strong> </strong>Fully understand the security implications of any third-party technologies you integrate into your application. Audit their configurations and disable any unused or unnecessary features that could increase the risk of information disclosure. Regularly check for security updates or patches to mitigate vulnerabilities introduced by third-party software.</li><li><strong>Regular security testing</strong>: Conduct regular security audits and code reviews as part of your QA or build processes to identify potential information disclosure points, with opportunities to automate tasks like stripping developer comments.</li><li><strong>Raise awareness and provide training</strong>: Ensure everyone involved in producing the application understands what constitutes sensitive information and the risks of exposing seemingly harmless data. Regular training and clear guidelines will help prevent accidental disclosures.</li></ul><h3>Final Thoughts</h3><p>Information disclosure vulnerabilities are often underestimated, but as we’ve seen, even minor leaks can lead to severe security breaches. Real-world incidents have proven that organizations must treat these vulnerabilities with the same seriousness as more overt threats, adopting a proactive approach to detection and remediation.</p><p>Stay vigilant, think like an attacker, and remember: in cybersecurity, even the smallest crack can shatter the strongest defenses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a079b0a0dddf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>