<?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 Tanner on Medium]]></title>
        <description><![CDATA[Stories by Tanner on Medium]]></description>
        <link>https://medium.com/@cachemoney?source=rss-35624e48d5fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CSix1lI_5S7s43OVvfWCjA.png</url>
            <title>Stories by Tanner on Medium</title>
            <link>https://medium.com/@cachemoney?source=rss-35624e48d5fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 06:51:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cachemoney/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[Exploiting Application Logic to Phish Internal Mailing Lists]]></title>
            <link>https://medium.com/@cachemoney/exploiting-application-logic-to-phish-internal-mailing-lists-486b94fc2ef1?source=rss-35624e48d5fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/486b94fc2ef1</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[phishing]]></category>
            <dc:creator><![CDATA[Tanner]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 17:01:49 GMT</pubDate>
            <atom:updated>2023-01-13T17:01:49.623Z</atom:updated>
            <content:encoded><![CDATA[<p>A while back I was tasked with performing a Red Team engagement on a tech company with a mature security program. Aside from all the normal technical testing, I wanted to run a phishing campaign to see if I could find a way to gain access to some of their highest value assets. The company has a talented, engaged, and proactive security team with a public bounty program boasting one of the highest payout tables around.</p><p>Scrolling through their company-wide security Slack channel and seeing tons of engagement from all teams posting security related articles, technical blogs, and discussions, it was clear security is ingrained in their culture far beyond the security team. At that point I realized that phishing experienced, tech savvy, and security aware employees was going to take something a little more creative than your run-of-the-mill campaign. Here’s how I managed to leverage their own application’s logic to gain access to some of their most critical assets.</p><p><em>Note: I use “example.com” throughout this post as a reference to this organization.</em></p><h3>Single Sign-On</h3><p>As with most companies they’re reliant on an identity provider for authentication, in this case Okta. It’s a double edged sword. Great for access control/logging/removing passwords etc. but risky in the sense that if an employee’s Okta account gets compromised it’s basically game over. Naturally that makes it the top contender for my campaign.</p><h3>Creating a page</h3><p>First we want to develop a replica Okta login page capable of stealing full sessions. Easy thanks to the incredible work of Kuba Gretzky in developing <a href="https://github.com/kgretzky/evilginx2">EvilGinx</a>.</p><h3>Choosing a domain</h3><p>Hosting the page on a convincing domain isn’t as straightforward as you might expect. <a href="https://developers.google.com/safe-browsing/v4/advisory">Google automatically looks for and blocks suspicious domains</a> which mimic popular services. I had a killer phishing domain that included the word “okta” in it, and within 40 minutes it was completely blocked on all browsers. <em>Aargh!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*rd227RP_n4bHH-uZiwpvvw.png" /><figcaption>Example of the blocked domain after just 40 minutes.</figcaption></figure><p>Not only that. If a company uses a brand monitoring service such as <a href="https://markmonitor.com/">MarkMonitor</a>, that will also trigger alerts. So you need to find something that’s believable, won’t get flagged by Google, and won’t trigger any monitoring services. The best way to do this is to completely leave the company name and “Okta” out of the domain.</p><p>Doing some recon I noticed the internal domains were often variations of shortened domains with the brand initials. This made things easy as I was able to register a domain that nobody had seen before, but one that users would assume is legitimate because of the existing variety of internal domains.</p><p>Add the word “secure” and “okta” as subdomains because that means it’s legitimate of course! The full domain looks like “secure.okta.exmpl.com”.</p><p>Make sure any domain you register for your campaign you visit in multiple browsers, and wait at least a day before using it to make sure it doesn’t get hosed. A real tragedy would be sending out your campaign and having Google block it shortly after.</p><h3>Getting the link into an inbox</h3><p>The next step was by far the most difficult and the meat of the post. Remember, this isn’t some corporate phishing exercise where all the user has to do is click a link. We need a high number of employees to visit our page and hand over their full Okta credentials without thinking twice.</p><p>The challenges:</p><ul><li>Google will likely identify an unsolicited email with a link as a phish or spam. They’ve gotten pretty decent at this and throw enough warnings where I would consider this a failure. You <em>might </em>get someone, but our goal is to compromise as many high value accounts as possible.</li><li>Companies often add [EXTERNAL] tags or labels to emails coming from non-whitelisted domains, putting users on heightened alert.</li><li>Having a call to action (CTA) convincing enough to get savvy users to enter these credentials might be a little tricky.</li></ul><h4>The solution — Leverage the application</h4><p>The way we can bypass all these restrictions is by sending an email from the company itself. Most applications send emails on various actions. Sign up, password reset etc. Can we hijack any of them?</p><p>The application I was testing had a section for SAML authentication. Not to get into the details of SAML; but at a high level, the Service Provider (SP) redirects to the Identity Provider (IdP) such as Okta for authentication. This is referred to as SP initiated auth.</p><p>When an organization sets up SAML on their account they choose the URL for the IdP. This is so when a user visits <em>example.com</em> to login, they can enter their email and get redirected to the IdP which authenticates them, and then POSTs the SAML response back to <em>example.com</em> to authenticate them without a password. The key part here is that the IdP URL is user defined. If I make my IdP URL my Okta phishing page, now users will be expecting to go to a legitimate IdP but land on my malicious page instead.</p><p>This gives us an open redirect from the company site to the phishing page, which we now need to get into a user’s inbox. Luckily a common flow is to allow organizations to invite other users, which sends an email to them with a CTA such as “[Company] has invited you to their organization, click here to join”. In this case we can name our malicious organization something convincing such as “[Target Company] testing”, or “[Target Company] experiments”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOjOxpoQ023xPKmuk_26Tg.png" /><figcaption>Inviting a user into your organization sends them this email with an attacker defined link.</figcaption></figure><p>Using this feature we can have a legitimate email come from the company itself into employee inboxes with the primary CTA being a link to a phishing Okta page. This allows us to send targeted phishing links to individual employees, but can we do better?</p><h3>Posting to internal mailing lists using Google’s intended behavior</h3><p>There’s an unexpected and kind of dangerous behavior with the way Google handles mailing lists (Google Groups) which can allow outsiders to post to them using application logic. It’s the fact that Google allows managed domains to post to internal Groups from any email address on the domain, regardless of if they are a defined user in the organization. For example: If the Google Group allows the “Entire Organization” to post (default when creating), an email such as <em>non-existent@example.com</em> or a managed <em>non-existent@sub.example.com</em> can post internally to any group under <em>example.com</em>. I reported this to Google and they closed the report as intended behavior.</p><h3>Putting it all together</h3><p>Since the organization invite emails were being sent from a <em>no-reply@mail.example.com</em>, I was simply able to invite common mailing lists such as <em>engineering@example.com</em> as users into my organization. Doing so would end up posting to the internal group and send out the malicious organization invite to hundreds of employees. Few things will look more legitimate to a user than an email to them from their own company posting to an internal mailing list. In a short time frame I managed to capture a bunch of full Okta sessions, with the first victim minutes after sending out the invite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*lD3j-TE2Zk--fMsH99f3Gw.png" /><figcaption>Inviting the entire mailing list as a user in the organization.</figcaption></figure><h3>Bypass to launch MFA protected apps</h3><p>The Okta instance was set up such that sensitive apps prompt MFA to launch. This can be an effective security measure as the attacker doesn’t have access to your MFA device, and you cannot add another factor without confirming an existing one. The caveat in the implementation is that after authenticating there’s a couple minute window where MFA is not prompted again to add a new factor. This means that after stealing an Okta session, the attacker can quickly visit the user settings page and add their own factor without being prompted for the existing one. Afraid they’ll see an email notification that a new factor was added? Use Okta to login to their email and delete it. Once an attacker adds their own factor they can launch protected apps and authenticate freely into the account with the captured password.</p><h3>Takeaways</h3><p>As convincing as it was, not everyone fell for the phish. Here are some of the users I was unable to capture:</p><ul><li>The users with their second factor being a FIDO device, which cannot be phished.</li><li>The users with a sharp eye who noticed the login page is not actually on their Okta domain.</li><li>Some of the users that were using password managers and noticed auto-fill wasn’t coming up, after which they then noticed the domain was fake.</li></ul><p>Those users were quick to alert the IT team to investigate the issue who then had the ability to purge it from inboxes.</p><p>Phishing is still one of the leading causes of breaches and I believe attacks will continue to evolve past the basic training we’re all given. In this case I was able to compromise highly technical, smart, and well trained individuals by using an attack which leverages the application itself. A few technical solutions can be used to prevent this and similar types of attacks.</p><ul><li>Require FIDO as a secondary factor and <strong>disable other factors</strong>.</li><li>Do not allow user defined links or redirects inside of emails sent from the application.</li><li>Send emails from a different domain so internal mailing lists cannot be posted to, or only allow posting from “Group Members”.</li></ul><h3>Who else is vulnerable?</h3><p>I would say most companies which have SSO and a similar organization invite structure. I can think of a bunch of high profile services off the top of my head I would love to test. Unfortunately, phishing is almost always out of scope for bug bounties and public security testing.</p><p>Thanks for reading and I hope you can use this information to secure your organization’s assets!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=486b94fc2ef1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using a GitHub app to escalate to an organization owner for a $10,000 bounty]]></title>
            <link>https://medium.com/@cachemoney/using-a-github-app-to-escalate-to-an-organization-owner-for-a-10-000-bounty-4ec307168631?source=rss-35624e48d5fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ec307168631</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bounty-program]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Tanner]]></dc:creator>
            <pubDate>Wed, 20 Jun 2018 19:58:04 GMT</pubDate>
            <atom:updated>2025-03-24T20:26:35.649Z</atom:updated>
            <content:encoded><![CDATA[<p>I had never participated in GitHub’s <a href="https://blog.github.com/2018-03-14-Four-years-of-bug-bounty/">long running bounty program</a> in the past, but the <a href="https://www.hackerone.com/hacktheworld/2017">HackTheWorld</a> promo of free private repositories for life piqued my interest. I’m going to walk through a simple yet high-impact privilege escalation I landed on while poking around. In this case, I was able to leverage a GitHub app to escalate from an organization member to an account owner.</p><h3>Background</h3><p>First, let’s go over the simple user roles of a GitHub organization. I added this section to demonstrate the capabilities of an owner account, and how there are measures put in place to minimize granting it.</p><ul><li>Outside collaborator (for completeness) — A role where you’re technically not part of the organization, but just given access to specific repositories inside.</li><li>Member — The lowest role you can have inside of an organization. Depending on the organization settings, you may be limited to viewing or having “write” access on a subset of repositories. The highest level of access you can be given with this permission is a repository admin, which will allow changing most configuration settings for that specific repository.</li><li>Owner — The highest role you can have inside of an organization, which is basically the equivalent of a super admin. This role allows you to view and edit all organization data and repositories; but more critically, irreversibly delete the entire organization and its code.</li></ul><p>Organizations are widely used throughout GitHub, and the common assumption is that their members don’t pose a threat when the proper access controls are in place (ex. not giving admin access to every repository). A common model is to put members into “teams”, and use those to facilitate access control across repositories. Using this model, organization owners can be limited to a very small subset of users, since team-based controls are sufficient to give extended access where needed.</p><h3>Digging into GitHub apps</h3><p>While going through the organization settings as an owner, I noticed a “Third-party access policy” switch. The purpose of this setting is to prevent members of your organization from giving repository access to untrusted 3rd parties via OAuth. Once enabled, a member must specifically request access from the OAuth permissions prompt, which then requires approval by an organization owner before it can access any organization data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*45w2py5reN2DK0ccRykV1w.png" /><figcaption>Playing around with those settings didn’t lead anywhere, and I couldn’t find a way to bypass the approval requirement.</figcaption></figure><p>The next thing I looked into was another kind of app, an integration. Integrations are similar to OAuth apps, except they act on behalf of the organization instead of the user. My thought process was to check if the “Third-party access policy” would apply to integrations as well, or if those would slip through. I navigated to the <a href="https://github.com/marketplace">marketplace</a> and went through the installation flow with a few apps. It was clear that as an organization <strong>member</strong>, you’re not given the option to install the integration. You can only install integrations into your own account, or for organizations of which you’re an owner. I later found the following note in the <a href="https://developer.github.com/apps/building-integrations/setting-up-a-new-integration/about-choosing-an-integration-type/">documentation</a>.</p><blockquote><em>Organization members can’t request a GitHub App installation.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*Qm3ioBuabqNdnHqAwfZt3w.png" /><figcaption>The integration can only be installed into my account, or to an organization for which I have “owner” permissions.</figcaption></figure><p>While going through the installation flow, I noticed that after choosing a “Billing account” you’re brought to a screen that has a URL such as: <a href="https://github.com/apps/:app_name/installations/new/permissions?target_id=:id">https://github.com/apps/:app_name/installations/new/permissions?target_id=:id</a></p><p>The target_id is the organization_id, or the account_id where the app is to be installed. Naturally, as a <strong>member</strong> of <em>another</em> organization, I crossed my fingers and changed the target_id to that organization_id. Since my member account was a repository admin, I was prompted with the installation page. I was successfully able to install the app, but only to the one repository for which I had admin rights to. I double checked the installation by visiting the “Installed GitHub Apps” page from the organization owner account. Success!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*6YOchgJSXmcOy-dFfQzErQ.png" /><figcaption>Integration successfully installed into the account that which I am a <strong>member</strong>.</figcaption></figure><p>At this point it was past 3am, and I knew I had found a valid issue since I circumvented the “Third-party access” restriction that was set. I went ahead and reported it to the GitHub program, with the intention of leaving comments in the report for any later findings.</p><h3>Taking the elevator to the penthouse</h3><p>The next day I wanted to see if I could take this any further. I created my own GitHub integration, and noticed the permissions that could be requested were extremely sensitive. Particularly the permission to have “write” access to all organization members and teams. Surely having the permission to install an integration into one repository won’t allow me to grant “write” access to all of the organization’s members, right? Incorrect. Since the <em>intended</em> design is such that only owners can install integrations, having the permission is binary. The scopes you can grant aren’t enforced, since you’re already considered to have the highest level of access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*gc4bECiVgMTUDRKyGdOXyA.png" /><figcaption>Installing the app while requesting a boatload of permissions.</figcaption></figure><p>The next step was to see if the API worked as expected, and if I was actually able to use it without running into a permissions error down the line. I successfully messed around with a bunch of endpoints before landing on the holy grail. <a href="https://developer.github.com/v3/orgs/members/#add-or-update-organization-membership">Add or update an organization membership</a> with a role parameter. Using that endpoint, I was successfully able to invite another user into the organization as an account owner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*dzpzBStfbl4QbItOrnuWTg.png" /><figcaption>Audit log entries for the underprivileged “OrgMember” account installing the integration — then using the API to invite “NewMember” as an owner.</figcaption></figure><h3>Prevalence</h3><p>I figured the good in this was that it was only able to be exploited by a repository admin. How many of those could you possibly have in your organization? After more investigation, I found that all organizations that allow members to create repositories are vulnerable. That’s because a member is automatically given admin rights to any repository they create; allowing them to exploit this by just creating a dummy repository to install the app into. This feature is enabled by default, and it’s common for organizations to leave it enabled since GitHub’s payment model <a href="https://help.github.com/articles/switching-from-per-repository-to-per-user-pricing/">is no longer repository bound</a>, but based on the number of users.</p><p>Exploitation of this bug isn’t necessarily going to be through malicious insiders, but through attackers compromising member accounts. Let’s say an organization has 300 members in it; the surface area for an attacker to go after is no longer limited to the 3 or 4 organization owners, but any of its members.</p><p>As always, it’s been a pleasure working with the GitHub security team!</p><h3>Timeline</h3><ul><li>Initial report: 11/11/17 @ 3:30 AM</li><li>Reporting the ability to escalate to organization owner: 11/11/17 @ 8:30 PM</li><li>GitHub team officially looking into the issue: 11/13/17 @ 5:30 AM</li><li>Bounty of $10,000 awarded and triaged: 11/14/17 @ 1:40 PM</li><li>Fix deployed to production: 11/15/17</li><li>Issue marked as resolved: 12/1/17</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ec307168631" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>