Skip to content
Access control Write-up Intermediate

From URL dumps digging to IDOR , BAC, Massive Phishing in Udemy

Invitation links for Udemy business accounts were publicly archived on a malware scanner and could be redeemed by anyone without verifying the intended recipient. Separately, changing the organisation handle in the Host header exposed other organisations' learning paths and trial data, and a permissions endpoint let the author add themselves as an editor on any learning path.

Mostafa Mamdoh Follow

Published on hector0x.medium.com

Bounty$1,300 View original

Mostafa Mamdoh

Mostafa Mamdoh, on hector0x.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. 8 min read.

Context

Udemy for Business is the enterprise side of Udemy: organisations get their own account, reachable at a handle-based host of the form handle.udemy.com, and members inside that organisation can create and share content with colleagues. One of those features is Learning Paths, which the report describes as letting a business organisation member, whether a user or a moderator, create learning tracks and share them with others in the same organisation only. Another is a recommending feature that lets a member recommend courses to other users inside the same organisation.

The write-up covers four issues found while poking at these features: broken access control on organisation invitations, information disclosure of learning paths and trial organisation status through the Host header, an IDOR on learning path permissions, and HTML injection in the recommendation message that could be turned into a large-scale phishing campaign.

Setup

The researcher started from OSINT tooling rather than from the target directly. The entry point was urlscan.io, a site that scans a URL for the possibility of being malware or a phishing site and archives every submitted scan for public access, searchable by domain name or by a keyword in the URL. The idea was to search for well-known sites such as Twitter, Uber and Udemy in the hope of finding private instances or pages that are less accessible to the public.

The search used was:

No special accounts, roles or tool versions are described beyond a Burp Suite proxy used to intercept requests, and a personal (non-business) Udemy account created through the normal signup flow at https://www.udemy.com/join/signup-popup/.

Finding it

Two URL shapes in the archived scans stood out:

Text
*.udemy.com/?data=token
*.udemy.com/organization/accept-invitation/?email=token

These were invitations for business accounts belonging to many companies that use Udemy for Business. The invitations kept leaking onto the malware scanner over time because users at those companies were submitting the invitation URLs to be scanned for malware.

Exploitation

Step 1: Claiming organisation invitations (broken access control)

The invitation URLs could be claimed by anyone, with no extra verification that the person redeeming the invitation was the intended recipient. The fix applied by Udemy was to require an extra verification step before an invitation can be redeemed.

Step 2: Getting a business account to explore with

Udemy business trial accounts did not expose all business functions or endpoints in their API, so the researcher claimed one of the leaked tokens to obtain a business account and test the full set of functionality. That is how the Learning Paths feature was found.

Step 3: Disclosing other organisations' learning paths via the Host header

With Burp intercepting traffic, requests to *.udemy.com/learningpaths were captured:

HTTP
GET /api-2.0/learning-paths/?page=1&page_size=20&fields[learning_path]=@default,is_user_enrolled,estimated_content_length,num_enrollments,folder_ids,is_owner_in_group&list_type=all&ordering=-created HTTP/1.1Host: █████.udemy.comHTTP/1.1 200 OK{“count”:30,”next”:”█████","previous":null,"results":[{"_class":"learning_path","id":█████504,"title":"Ethical Hacking”,”description”:”Path to becoming Ethical Hacker. Learning journey would include Web app hacking, N/W hacking, AD hacking, Privilege escalation and much more.”,”owner”:{“_class”:”user”,”id”:█████6538,”display_name”:”█████S”,”image_50x50":”*","initials":"SP"},"is_public":true,"editors":[{"_class":"user","id":█████6538,"display_name":"█████S”,”image_50x50”:”█████","initials":"SP"}],"is_user_enrolled":false,"estimated_content_length":3172,"num_enrollments":2,"folder_ids":[],"is_owner_in_group":false},}

The request lists learning paths with paging, a field selection and ordering, and the response returns a count of 30 plus a page of results. Each result carries the learning path title and description, the owner's user object (id, display name, image, initials), the editors list, enrolment counts and content length.

Because every organisation is identified by its handle in the host, changing the account name in the Host header to another organisation's account name returned all learning paths created on that organisation, together with their members' data. The same attack vector was then tested against other API endpoints that do not require an account id in the request according to the API documentation.

Step 4: Disclosing trial organisation status

One of those endpoints returned trial data for the organisation named in the Host header:

HTTP
GET /api-2.0/organization-trial/status/ HTTP/1.1Host: █████.udemy.comHTTP/1.1 200 OK{“available_count”: 5, “active_remaining_days”: 0, “owner_email”: “█████”, “trial_limit_reached”: false, “used_count”: 0, “owner_name”: “█████”, “is_owner”: false, “remaining_seats”: 0}

By swapping the account name in the Host header for another organisation's, the response disclosed that organisation's trial data, including the owner's email address and name, seat counts and remaining days.

Step 5: Adding yourself as an editor of any learning path (IDOR)

While testing, the researcher noticed a request sent to the permissions endpoint of a learning path:

HTTP
PUT /api-2.0/learning-paths/█████886/permissions/ HTTP/1.1Host: █████.udemy.com{"added_editors_ids":[],"removed_editors_ids":[]}

Changing the learning path id to a random one and putting his own user id into added_editors_ids produced:

HTTP
PUT /api-2.0/learning-paths/█████514/permissions/ HTTP/1.1Host: █████.udemy.com{“added_editors_ids”:[152495920],”removed_editors_ids”:[]}HTTP/1.1 200 OK{"results":[{"_class":"user","id":█████034,"display_name":"█████vschi","image_50x50":"█████","initials":"AP"},{"_class":"user","id":152495920,"display_name":"Mostafa Mamdoh","image_50x50":"█████","initials":"MM"}]}

The response lists the editors of the learning path, now including the researcher's own account. This worked for any learning path in the same or a different organisation. The same endpoint also allowed removing any editor by putting that editor's id into removed_editors_ids.

Step 6: HTML injection in the recommendation message

The recommending feature is meant for members of the same organisation. Intercepting it in Burp gave:

HTTP
POST /api-2.0/share/course/█████/recommend/ HTTP/1.1-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████388-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████382-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████580-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████083-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████288-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████988-----------------------------[redacted]-Disposition: form-data; name="message"<h1>Hey █████</h1>Please go to https://evil.com/accept to redeem your invite <img src="https://pbs.twimg.com/profile_images/810954665202434052/_m3mPbHa_400x400.jpg" alt="Smiley face" width="42" height="42" style="vertical-align:bottom">-----------------------------[redacted]-Disposition: form-data; name="context"ufb_clp-----------------------------374017102511920071852193229569--

The request is multipart form data. Repeated userIds[] parts select the recipients, the message part carries the body, and a context part is set to ufb_clp. The message value is HTML: a heading, a link to https://evil.com/accept framed as an invitation to redeem, and an image tag. The researcher added many user ids to the request, including personal (non-business) accounts created through the normal signup flow, and the mail was delivered.

Because the endpoint did not implement rate limiting at the time, the researcher states that in theory a massive injected phishing message could have been sent to all Udemy users, personal or business, by iterating over all user ids. The report puts the user base at nearly 150,000,000 users at the time of reporting.

Root cause

Three separate design mistakes are visible. The invitation flow trusted possession of the invitation URL as proof of identity, so a leaked link was enough to join an organisation. Changing the account name in the Host header returned another organisation's learning paths and trial status. The permissions endpoint took the learning path id from the path and the editor ids from the body without verifying that the caller had authority over that learning path, which is a classic IDOR. The recommendation endpoint accepted HTML in the message field and arbitrary recipient ids without rate limiting, and the mail was delivered.

Impact

Anyone who found a leaked invitation URL could claim it without extra verification. Changing the account name in the Host header returned another organisation's learning paths with member data, and its trial data including the owner's email address and name. The researcher could add himself as an editor of any learning path, in the same or a different organisation, and remove any editor. Finally, the researcher states that in theory a massive injected phishing message could have been sent to all Udemy users, personal or business, by iterating over all user ids, as the endpoint had no rate limiting.

Fix

Udemy fixed the invitation issue by requiring an extra verification before an invitation can be redeemed. The report does not describe the changes made for the other three issues.

Timeline as given in the report:

Date Event
March 3, 2021 Vulnerabilities reported
April 7, 2021 Total bounties awarded 1300$
August 7, 2021 Reports resolved

Variants to test

  1. Search public URL archives and scanners for invitation and token URLs of the target (?data=token, /accept-invitation/?email=token style paths). A positive result is a live invitation link that can be redeemed without proving you are the intended recipient.
  2. On multi-tenant SaaS, change the tenant identifier in the Host header while keeping your own session, and replay API calls that do not carry an account id. A positive result is another tenant's data in the response.
  3. Take any object id in a path (/learning-paths/<id>/permissions/) and swap it for an id belonging to another tenant, then attempt a write such as adding your own user id. A positive result is a 200 response listing you among the object's editors.
  4. Look for endpoints that accept a list of recipient ids plus a free-text or HTML body, and check whether markup is rendered in the delivered message. A positive result is your HTML appearing in the received mail.
  5. Test the same recipient-list endpoint without rate limiting by sending a large batch of ids. A positive result is that all of them are accepted in a single request or across rapid repeated requests.

Tips from the report: use public URL archives or scanners to recon for private instances or leaked tokens belonging to sensitive features, and try to elevate the impact of content injections by chaining them with phishing scenarios.

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. 18 min read.

What happened, in plain words

A security researcher was browsing a public website called urlscan.io. That site scans web addresses (URLs) to check whether they are malicious, and it keeps every scan it has ever run in a public archive that anyone can search. While searching that archive for well-known sites, the researcher found invitation links for Udemy for Business, the enterprise side of Udemy where companies get their own private space. Those invitation links had been scanned by employees of the companies and were now sitting in the public archive. Anyone who found one could use it to join that company's account, because the link itself was treated as proof that you were the invited person.

From there the researcher claimed one of those invitations to get a business account, explored the features that business accounts can use, and found several more problems. By changing one small piece of information in each request (the name of the company in the Host header, or the number identifying a learning path), the researcher could read other companies' data and give himself editor rights on any learning path. Finally, a feature that lets members recommend courses to colleagues accepted HTML in the message body, so a crafted message could contain a fake link and an image. Because the endpoint had no rate limiting, the researcher argues the same trick could in theory have been used to send phishing mail to every Udemy user.

Udemy fixed the invitation problem by requiring an extra verification step. The report does not describe the fixes for the other issues. The researcher was paid 1300 USD in total, and the reports were resolved on August 7, 2021.

Background: the product and the features

Udemy for Business is the enterprise side of Udemy. A company signs up and gets its own account, reachable at a web address of the form handle.udemy.com, where handle is the company's account name. Think of it like a company's own sub-site inside a larger building: same building, but each company has its own door with its own name on it. Members inside that organisation can create and share content with colleagues.

Two features matter here:

  • Learning Paths: the report describes this as letting a business organisation member, whether a user or a moderator, create learning tracks and share them with others in the same organisation only. A learning path is a curated list of courses, like a reading list for a study programme.
  • A recommending feature: it lets a member recommend courses to other users inside the same organisation. The recommendation arrives as an email.

The write-up covers four issues found while poking at these features:

  1. Broken access control on organisation invitations.
  2. Information disclosure of learning paths and trial organisation status through the Host header.
  3. An IDOR on learning path permissions.
  4. HTML injection in the recommendation message that could be turned into a large-scale phishing campaign.

How the researcher got started

The researcher started from OSINT tooling rather than from the target directly. OSINT means open-source intelligence: gathering information from public sources, the way a journalist might search public records before making a phone call. The entry point was urlscan.io, a site that scans a URL for the possibility of being malware or a phishing site and archives every submitted scan for public access, searchable by domain name or by a keyword in the URL.

The idea was to search for well-known sites such as Twitter, Uber and Udemy in the hope of finding private instances or pages that are less accessible to the public. In other words: people submit links to this scanner to check them, and the scanner keeps a copy. If an employee submits a private link, that private link is now public.

The search used was:

Line by line: this is a normal web address for the urlscan.io search page. The part after the # is a search instruction rather than a page path. page.domain:udemy.com tells the site to show every scan whose page belongs to the domain udemy.com. A domain is the host part of a web address, here udemy.com. So the search returns every archived scan of any Udemy page.

No special accounts, roles or tool versions are described beyond a Burp Suite proxy used to intercept requests, and a personal (non-business) Udemy account created through the normal signup flow at https://www.udemy.com/join/signup-popup/.

A proxy like Burp Suite sits between your browser and the website. Your browser sends its request to the proxy, the proxy shows it to you, and then forwards it on. It is like a mailroom that opens every letter, lets you read and rewrite it, and then sends it on. This is how the researcher could see and edit the requests described below.

Finding it

Two URL shapes in the archived scans stood out:

Text
*.udemy.com/?data=token
*.udemy.com/organization/accept-invitation/?email=token

Line by line: the * is a wildcard meaning any subdomain, so *.udemy.com covers something.udemy.com, other.udemy.com and so on. The first shape is a page on any Udemy subdomain that takes a value called data in the query string. The query string is the part of a URL after the ?, made of name and value pairs. The second shape is the invitation acceptance page, which takes an email value in the query string.

A token here is a long random-looking string that acts as a key. If you have the key, you can open the door. These were invitations for business accounts belonging to many companies that use Udemy for Business. The invitations kept leaking onto the malware scanner over time because users at those companies were submitting the invitation URLs to be scanned for malware. The employees were trying to protect themselves and, without meaning to, published the keys.

Exploitation

Step 1: Claiming organisation invitations (broken access control)

The invitation URLs could be claimed by anyone, with no extra verification that the person redeeming the invitation was the intended recipient. The fix applied by Udemy was to require an extra verification step before an invitation can be redeemed.

Broken access control is the general name for this kind of mistake: the system has a rule about who is allowed to do something, but the rule is not enforced, or is enforced in the wrong place. A simple comparison: a hotel gives each guest a key card for their own room, but the door opens for any card at all. The lock exists, but it does not check whose card it is.

Why this step was taken: the researcher had found invitation links in a public archive. The obvious question is whether the link alone is enough to get in, or whether the site asks for something more, such as being logged in as the invited email address. Trying to redeem one answers that question.

Step 2: Getting a business account to explore with

Udemy business trial accounts did not expose all business functions or endpoints in their API, so the researcher claimed one of the leaked tokens to obtain a business account and test the full set of functionality. That is how the Learning Paths feature was found.

An API is the set of doors a website's own pages use to talk to its servers. When you click a button, your browser usually sends a request to an API address and gets data back, often in a format called JSON, which is just text organised as labelled values. An endpoint is one specific address in that API, like one specific counter at a service desk. A trial account is a free, limited version of a paid account.

Why this step was taken: the researcher needed a real business account to see the features that only business accounts can reach. The leaked invitation provided one without needing to be the invited person.

Step 3: Disclosing other organisations' learning paths via the Host header

With Burp intercepting traffic, requests to *.udemy.com/learningpaths were captured:

HTTP
GET /api-2.0/learning-paths/?page=1&page_size=20&fields[learning_path]=@default,is_user_enrolled,estimated_content_length,num_enrollments,folder_ids,is_owner_in_group&list_type=all&ordering=-created HTTP/1.1Host: █████.udemy.comHTTP/1.1 200 OK{“count”:30,”next”:”█████","previous":null,"results":[{"_class":"learning_path","id":█████504,"title":"Ethical Hacking”,”description”:”Path to becoming Ethical Hacker. Learning journey would include Web app hacking, N/W hacking, AD hacking, Privilege escalation and much more.”,”owner”:{“_class”:”user”,”id”:█████6538,”display_name”:”█████S”,”image_50x50":”*","initials":"SP"},"is_public":true,"editors":[{"_class":"user","id":█████6538,"display_name":"█████S”,”image_50x50”:”█████","initials":"SP"}],"is_user_enrolled":false,"estimated_content_length":3172,"num_enrollments":2,"folder_ids":[],"is_owner_in_group":false},}

Line by line, the request part:

  • GET is the method: the browser is asking to read something, not to change it.
  • /api-2.0/learning-paths/ is the endpoint being called.
  • ?page=1&page_size=20 asks for the first page of results, twenty at a time. The & separates parameters.
  • fields[learning_path]=@default,is_user_enrolled,estimated_content_length,num_enrollments,folder_ids,is_owner_in_group asks the server to include only these fields for each learning path. @default means the standard set.
  • list_type=all asks for all lists, and ordering=-created asks for newest first (the minus sign means descending).
  • HTTP/1.1 is the version of the web protocol being spoken.
  • Host: █████.udemy.com is the crucial line. The Host header tells the server which website name the browser was trying to reach. It is like writing the company name on the envelope. The server uses it to decide which organisation's data to show.

The response part:

  • HTTP/1.1 200 OK means the request succeeded. 200 is the standard success code.
  • "count":30 says there are thirty learning paths in total.
  • "next":"█████" is a link to the next page of results, and "previous":null means there is no previous page.
  • "results":[...] is the list of learning paths on this page.
  • Inside each result, _class says what kind of object it is (learning_path), id is its unique number, title and description are its name and summary.
  • owner is the user object of the person who created it: their id, display_name, image_50x50 (a small profile picture) and initials.
  • is_public says whether the path is public, editors lists the users who can edit it, is_user_enrolled says whether the caller is enrolled, estimated_content_length is a length estimate, num_enrollments is how many people are enrolled, folder_ids lists folders, and is_owner_in_group says whether the owner is in the group.

Because every organisation is identified by its handle in the host, changing the account name in the Host header to another organisation's account name returned all learning paths created on that organisation, together with their members' data. The same attack vector was then tested against other API endpoints that do not require an account id in the request according to the API documentation.

Why this step was taken: the researcher had noticed that the company name appears in the web address. If the server trusts that name to decide whose data to return, then changing the name should return someone else's data. That is exactly what happened. This is a form of information disclosure: the system reveals data to someone who should not see it.

Step 4: Disclosing trial organisation status

One of those endpoints returned trial data for the organisation named in the Host header:

HTTP
GET /api-2.0/organization-trial/status/ HTTP/1.1Host: █████.udemy.comHTTP/1.1 200 OK{“available_count”: 5, “active_remaining_days”: 0, “owner_email”: “█████”, “trial_limit_reached”: false, “used_count”: 0, “owner_name”: “█████”, “is_owner”: false, “remaining_seats”: 0}

Line by line: GET /api-2.0/organization-trial/status/ asks for the trial status of the organisation. Host: █████.udemy.com again names the organisation. The 200 OK response contains a JSON object with:

  • available_count: how many trial seats are available.
  • active_remaining_days: how many days of the trial are left.
  • owner_email: the email address of the organisation's owner.
  • trial_limit_reached: whether the trial limit has been hit.
  • used_count: how many seats have been used.
  • owner_name: the owner's name.
  • is_owner: whether the caller is the owner.
  • remaining_seats: how many seats remain.

By swapping the account name in the Host header for another organisation's, the response disclosed that organisation's trial data, including the owner's email address and name, seat counts and remaining days.

Why this step was taken: the same trick that worked on learning paths might work on other endpoints. The researcher tested endpoints that, according to the API documentation, do not need an account id in the request, because those are the ones where the server might rely on the Host header alone.

Step 5: Adding yourself as an editor of any learning path (IDOR)

While testing, the researcher noticed a request sent to the permissions endpoint of a learning path:

HTTP
PUT /api-2.0/learning-paths/█████886/permissions/ HTTP/1.1Host: █████.udemy.com{"added_editors_ids":[],"removed_editors_ids":[]}

Line by line: PUT is a method that means "create or replace this thing". The address /api-2.0/learning-paths/█████886/permissions/ points at the permissions of one specific learning path, identified by the number in the middle. Host names the organisation. The body is JSON with two lists: added_editors_ids (users to add as editors) and removed_editors_ids (users to remove). Both are empty here, which is what the normal page sends when nothing changes.

Changing the learning path id to a random one and putting his own user id into added_editors_ids produced:

HTTP
PUT /api-2.0/learning-paths/█████514/permissions/ HTTP/1.1Host: █████.udemy.com{“added_editors_ids”:[152495920],”removed_editors_ids”:[]}HTTP/1.1 200 OK{"results":[{"_class":"user","id":█████034,"display_name":"█████vschi","image_50x50":"█████","initials":"AP"},{"_class":"user","id":152495920,"display_name":"Mostafa Mamdoh","image_50x50":"█████","initials":"MM"}]}

Line by line: the path id is now a different number, and added_editors_ids contains 152495920, the researcher's own user id. The response is 200 OK, and its results list contains two user objects: one existing editor and the researcher's own account, with display name and initials. In other words, the server accepted the change and now lists the researcher as an editor.

IDOR stands for Insecure Direct Object Reference. It means the system lets you name an object by its number and does not check that the object belongs to you. A comparison: a cloakroom where you hand in a ticket with a number, and the attendant gives you whatever coat has the number you say, without checking that the ticket is yours. Here the "number" is the learning path id.

This worked for any learning path in the same or a different organisation. The same endpoint also allowed removing any editor by putting that editor's id into removed_editors_ids.

Why this step was taken: the researcher saw a request that changes who can edit a learning path. If the server trusts the path id in the address and the user ids in the body without checking that the caller has authority over that path, then any user can edit any path. Trying it with a random path id and his own user id tests exactly that.

Step 6: HTML injection in the recommendation message

The recommending feature is meant for members of the same organisation. Intercepting it in Burp gave:

HTTP
POST /api-2.0/share/course/█████/recommend/ HTTP/1.1-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████388-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████382-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████580-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████083-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████288-----------------------------[redacted]-Disposition: form-data; name="userIds[]"█████988-----------------------------[redacted]-Disposition: form-data; name="message"<h1>Hey █████</h1>Please go to https://evil.com/accept to redeem your invite <img src="https://pbs.twimg.com/profile_images/810954665202434052/_m3mPbHa_400x400.jpg" alt="Smiley face" width="42" height="42" style="vertical-align:bottom">-----------------------------[redacted]-Disposition: form-data; name="context"ufb_clp-----------------------------374017102511920071852193229569--

Line by line:

  • POST is a method that means "send this data to create something". The address /api-2.0/share/course/█████/recommend/ is the recommendation endpoint for one course.
  • The long dashed lines are boundaries. This request is multipart form data, a format that packs several separate pieces into one request, each with its own label. Think of it as one envelope containing several sealed letters, each marked with what it is.
  • Each Content-Disposition: form-data; name="userIds[]" line starts a new piece named userIds[]. The [] means the field can appear many times, once per recipient. The value after it is a user id. There are six of them here, so six recipients.
  • The piece named message carries the body of the recommendation. Its value is HTML: <h1>Hey █████</h1> is a large heading, then the text Please go to https://evil.com/accept to redeem your invite, then an <img> tag that loads a picture from pbs.twimg.com with alt text Smiley face, width and height 42, and a style that aligns it to the bottom of the line.
  • The piece named context has the value ufb_clp.
  • The final boundary ends with --, which marks the end of the request.

HTML is the language web pages are written in. Tags like <h1> and <img> tell a browser how to display text and pictures. When a message that contains HTML is displayed as HTML rather than as plain text, the tags are obeyed. That is HTML injection: your input is treated as instructions rather than as words.

The researcher added many user ids to the request, including personal (non-business) accounts created through the normal signup flow, and the mail was delivered.

Why this step was taken: the researcher wanted to know whether the message field is displayed as plain text or as HTML, and whether the recipient list is limited to the same organisation. Adding personal accounts to the list and putting HTML in the message tests both at once.

Because the endpoint did not implement rate limiting at the time, the researcher states that in theory a massive injected phishing message could have been sent to all Udemy users, personal or business, by iterating over all user ids. The report puts the user base at nearly 150,000,000 users at the time of reporting.

Rate limiting is a cap on how many requests one caller can make in a period. Without it, a script can send requests as fast as the network allows. Phishing is a fake message that pretends to come from a trusted source and pushes the reader to click a link or hand over information. Iterating over user ids means trying one number after another, the way you might dial every number in a range.

Root cause

Three separate design mistakes are visible.

  1. The invitation flow trusted possession of the invitation URL as proof of identity, so a leaked link was enough to join an organisation.
  2. Changing the account name in the Host header returned another organisation's learning paths and trial status. A tenant here means one company's separate space inside the shared service.
  3. The permissions endpoint took the learning path id from the path and the editor ids from the body without verifying that the caller had authority over that learning path, which is a classic IDOR.
  4. The recommendation endpoint accepted HTML in the message field and arbitrary recipient ids without rate limiting, and the mail was delivered.

Impact

Anyone who found a leaked invitation URL could claim it without extra verification. Changing the account name in the Host header returned another organisation's learning paths with member data, and its trial data including the owner's email address and name. The researcher could add himself as an editor of any learning path, in the same or a different organisation, and remove any editor. Finally, the researcher states that in theory a massive injected phishing message could have been sent to all Udemy users, personal or business, by iterating over all user ids, as the endpoint had no rate limiting.

Fix

Udemy fixed the invitation issue by requiring an extra verification before an invitation can be redeemed. The report does not describe the changes made for the other three issues.

Timeline as given in the report:

Date Event
March 3, 2021 Vulnerabilities reported
April 7, 2021 Total bounties awarded 1300$
August 7, 2021 Reports resolved

Variants to test

  1. Search public URL archives and scanners for invitation and token URLs of the target (?data=token, /accept-invitation/?email=token style paths). A positive result is a live invitation link that can be redeemed without proving you are the intended recipient.
  2. On multi-tenant SaaS, change the tenant identifier in the Host header while keeping your own session, and replay API calls that do not carry an account id. A positive result is another tenant's data in the response.
  3. Take any object id in a path (/learning-paths/<id>/permissions/) and swap it for an id belonging to another tenant, then attempt a write such as adding your own user id. A positive result is a 200 response listing you among the object's editors.
  4. Look for endpoints that accept a list of recipient ids plus a free-text or HTML body, and check whether markup is rendered in the delivered message. A positive result is your HTML appearing in the received mail.
  5. Test the same recipient-list endpoint without rate limiting by sending a large batch of ids. A positive result is that all of them are accepted in a single request or across rapid repeated requests.

Tips from the report: use public URL archives or scanners to recon for private instances or leaked tokens belonging to sensitive features, and try to elevate the impact of content injections by chaining them with phishing scenarios.

Glossary

  • API: the set of addresses a website's own pages use to talk to its servers, like a service desk with many counters.
  • Broken access control: a rule about who may do something exists but is not enforced, so the wrong person gets through.
  • Burp Suite: a proxy tool that sits between your browser and a website so you can read and edit requests.
  • Endpoint: one specific address in an API, like one counter at a service desk.
  • Handle: a company's account name, used in the web address handle.udemy.com.
  • Host header: the part of a request that names which website the browser was trying to reach.
  • HTML: the language web pages are written in, using tags such as <h1> and <img>.
  • HTML injection: when input containing HTML tags is displayed as HTML rather than as plain text, so the tags are obeyed.
  • IDOR (Insecure Direct Object Reference): naming an object by its number and getting it without the system checking that it belongs to you.
  • Information disclosure: the system reveals data to someone who should not see it.
  • JSON: a text format for data, organised as labelled values.
  • Learning Paths: a Udemy for Business feature that lets a member create learning tracks and share them with others in the same organisation only.
  • Multipart form data: a request format that packs several separately labelled pieces into one request.
  • OSINT: open-source intelligence, gathering information from public sources.
  • Phishing: a fake message that pretends to come from a trusted source and pushes the reader to click a link or hand over information.
  • Proxy: a middleman between your browser and a website that can show and change the traffic.
  • Rate limiting: a cap on how many requests one caller can make in a period.
  • Tenant: one company's separate space inside a shared service.
  • Token: a long random-looking string that acts as a key; whoever has it can open the door.
  • Trial account: a free, limited version of a paid account.
  • Udemy for Business: the enterprise side of Udemy, where organisations get their own account at handle.udemy.com.
  • urlscan.io: a site that scans a URL for the possibility of being malware or a phishing site and archives every submitted scan for public access.

More by Mostafa Mamdoh

View all

4 more disclosed reports, best first.

More from Udemy

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.