Skip to main content

The risks of over-logging: a case study on application takeover

Illustration of The risks of over-logging: a case study on application takeover
Securitum

Logs are often seen as a wall of text, filled with information that seems unimportant until a significant problem arises. Yet, have you ever thought about the security risks hidden within those walls of text, particularly when they include sensitive details like usernames and passwords? It’s a common belief that only trustworthy individuals, such as administrators, access these logs, but not considering the potential security implications can be a dangerous oversight. Today, we explore a case where logging non-sensitive data inadvertently led to a complete application takeover by a user with limited group privileges.

The Dilemma of Logging

For application developers, creating a robust logging system is essential for promptly identifying and resolving issues. The instinct may be to log as much information as possible for thorough debugging. However, this mindset can be detrimental to security. When logs become accessible or leaked, they can introduce a variety of threats—the more information logged, the greater the security risk.

Real-world Pentest Scenario Unveiled

Within the scrutinized application, there was a “manager” account with responsibilities to oversee a group of app users. Although this account did not have the front-end ability to edit other privileged users, such as managers or administrators, it had access to logs for efficient user issue resolution. These logs didn’t include direct sensitive data but detailed user activities, like sent emails, failed login attempts, and other internal app operations. The security risk arose with the logging of email messages, which, on the surface, was useful for confirming the dispatch of reminders for meetings. However, it became concerning when entire email contents were logged, exposing potentially sensitive information to the manager role.

Vulnerability at a Glance

Here is how the exploit was conducted step by step:

  1. The attacker requests an admin password reset through the password reset feature.
  2. The application emails the password reset link to the admin and logs the email’s content.
  3. The attacker, with manager-level access to logs, retrieves the password reset link intended for the admin.
  4. Using the intercepted link, the attacker resets the admin’s password.
  5. Complete control of the account and application is achieved by the attacker.

Unearthed Issues and Recommendations

It became clear that a manager should have log access strictly for their user group, and logs pertaining to other user groups should be reserved for administrator review only. A significant security lapse was the absence of additional protective measures like Two-Factor Authentication (2FA) for admin accounts, which could have prevented such an exploit.

Conclusion and Moving Forward

This case study highlights the need for heightened diligence in designing logging systems. Such systems must balance functionality and problem-solving utility with security concerns. Extra care should be taken to ensure information within logs is shared appropriately, as they can inadvertently become a tool for application compromise through unintentional exposure of operational data. Strengthening security for privileged accounts with measures against password reset or phishing attacks is of the utmost importance in the fight against rising cyber threats. As cybersecurity becomes increasingly critical, robust logging practices are not merely an option but a necessity.

Consider seeking expertise in cybersecurity for a thorough security audit of your applications to protect against these and other potential vulnerabilities.

Other Insights

Illustration of Unveiling hidden data: a log file's security breach

Unveiling hidden data: a log file's security breach

ROBERT KRUCZEK

Unveiling hidden data during 2023 pentest: how a misplaced log file can compromise 2FA security. Conducting penetration tests requires the use of existing solutions that significantly facilitate the work. For web applications, it is valuable to recognize the structure of directories or find files of interest. For this purpose, we can use applications such as: ffuf, dirbuster, gobuster. During the discussed test, I used the ffuf tool with a basic dictionary available publicly: https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/common.txt

READ article
Illustration of Attacking Artificial Intelligence - 3 common ways

Attacking Artificial Intelligence - 3 common ways

Tomasz Turba

Large Language Models (LLM) like ChatGPT, Bing and Bard can be attacked by threat actors. These AI systems could be vulnerable to attacks where threat actors can manipulate the prompt in order to alter their behavior to serve a malicious purpose. As AI components are further integrated into society's critical systems, their potential vulnerabilities could significantly impact the security of both companies and entire countries.

READ article
Illustration of Demystifying Prototype Pollution and its link to DOM XSS

Demystifying Prototype Pollution and its link to DOM XSS

Kalina Zielonka

JavaScript, the backbone of many web applications today, brings with it flexibility and potential. At the core of its architecture, every element we interact with is essentially an object, each with its own unique properties and methods. The Role of Prototypes in JavaScript Prototypes allow JS to share attributes or properties between different objects. Every object in JS has a prototype object associated with it, which gives that object its own properties. In other words, an object in JS inherits all the properties of its prototype.

READ article
A professional cybersecurity consultant ready to assist with your inquiry.

Any questions?

Happy to get a call or email
and help!