Skip to content
XSS Write-up Advanced

Obtaining XSS using moodle featured and minor bugs

Moodle allowed users to embed arbitrary HTML and JavaScript in their personal dashboards, which is normally only visible to themselves. By combining this with a login CSRF and a technique using duplicate session cookies with different paths, an attacker could run JavaScript in the context of another user's session, including an administrator, and upload a malicious plugin to gain shell access.

Daniel Thatcher Follow

Published on medium.com

Moodle allowed users to embed arbitrary HTML in their own dashboards, which are only visible to themselves, creating a situation which is equivalent to self-XSS. In this blog post I describe how it was possible to exploit this by setting a second session cookie with a restricted path, initially in combination with…

Daniel Thatcher, 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. 10 min read.

Moodle allowed users to embed arbitrary HTML in their own dashboards, which are only visible to themselves, creating a situation equivalent to self-XSS. This write-up describes how it was possible to exploit this by setting a second session cookie with a restricted path, initially in combination with login CSRF, and then by using Moodle's builtin impersonation functionality, to target other users. While much of the previous exploitation of self-XSS only allows the attacker to obtain read-only access to the DOM, this technique allows JavaScript to be run as the victim user, as with any regular XSS.

The following video shows how an administrator can be targeted to give an attacker shell access to the Moodle server. In the video, an administrator follows a link sent to them by an attacker. The next time the administrator logs in to their account in the same browser, a malicious plugin which gives the attacker a shell on the web server is uploaded using JavaScript.

Or watch on YouTube
From the original on medium.com

Targeting an administrator to upload a malicious plugin

Context

Moodle is a learning platform. Authenticated users can add HTML blocks containing scripts to their Dashboard. As a Moodle security announcement put it:

Authenticated user[sic] are allowed to add HTML blocks containing scripts to their Dashboard and this is normally not a security issue because personal dashboard is visible to this user only.

While this is more of a feature than stored self-XSS, it creates an equivalent situation: users can insert arbitrary HTML and JavaScript which runs in the context of the target domain, but should only ever be rendered in their own browser.

The login form also had no CSRF protection. That alone made it possible to obtain read-only access to any page a victim user is able to view, but did not allow anything of great interest to be leaked from a Moodle installation with minimal extra configurations (perhaps, the author notes, due to his lack of knowledge of Moodle). The goal therefore became turning this into full XSS where arbitrary JavaScript could be run as a victim user.

Setup

The exploitation uses a Moodle installation at http://moodle.[redacted], containing an administrator account named admin and a low privileged account the attacker has access to, named attacker. There is also a server belonging to the attacker at attacker.[redacted]. All the files used are available in the moodle-login-csrf GitHub repository.

The technique relies on two behaviours, one server side and one browser side.

Finding it

The method takes advantage of the way PHP and browsers treat multiple cookies with the same name.

PHP

If two session cookies are sent in a request to Moodle, the first session cookie which appears in the Cookie header is used, while the second is ignored. In the request below, the session cookie highlighted in bold in the original is used to identify the logged in user, while the other session cookie of the same name is ignored:

HTTP
GET /my/ HTTP/1.1...Cookie: MoodleSession=[redacted]; MoodleSession=[redacted]

This is a result of PHP's behaviour for handling multiple cookies, which leads to only the first cookie being present in the $_COOKIE superglobal.

Browsers

Chrome and Firefox (other browsers were untested) will generate a request containing duplicate cookies, such as the one above, when different values of the same cookie are set with different paths. So, say there are two cookies set in the browser:

  • a cookie named MoodleSession with a path of / containing a session identifier associated with Alice's account; and
  • a cookie named MoodleSession with a path of /my/ containing a session identifier associated with Bob's account.

This leads to only Alice's session cookie being sent in requests to paths outside of /my/, and both session cookies being sent in requests to /my/, which is the path of the user's dashboard in Moodle. It appears that both Chrome and Firefox send cookies with more restrictive paths first, so Bob's session cookie is the one sent first, and hence used by Moodle, when the browser requests /my/. A user of this browser sees all of the site as though they are logged in as Alice, apart from /my/, which shows Bob's dashboard.

Exploitation

The combination of CSRF on the login form and the double session cookie behaviour gives everything needed to target other users with JavaScript embedded on the attacker's dashboard.

1. Setup

First the attacker embeds a script such as the one from the GitHub repository, part of which is shown in the original, in their dashboard. This is most easily done by adding a new HTML block and using an intercepting proxy such as BurpSuite.

The first stage of the moodle.js script.

This script checks if a cookie named poisoned is set in the browser. If it is not, it sets this cookie, and requests a session cookie belonging to the attacker account from the cookie.php script, which it then puts in the MoodleSession cookie with a path of /my/. The script then causes a logout from the attacker account, which does not invalidate the newly set session cookie as it involves requests to paths outside of /my/.

If the poisoned cookie is present then the script executes the final XSS payload, discussed below.

2. Attack

The attacker now targets their victim user, in this case the owner of the admin account, with a simple login CSRF payload such as the one below, which logs the victim in to the attacker account.

Login CSRF to force a user to be logged in to the 'attacker' account.

This causes the victim to view the dashboard of the attacker account, and the script from the previous subsection to be run in their browser. The victim then has the poisoned cookie and a session cookie belonging to the attacker account set in their browser with a path of /my/, following which they are logged out.

The next time the victim logs in to the admin account in the same browser, they can browse all of the Moodle installation apart from their dashboard, including the admin panel, as normal. However, the request to /my/ to load their dashboard returns the dashboard of the attacker account with the included script. This script performs the second stage of the attack due to the presence of the poisoned cookie in the browser.

3. Final payload

Popping an alert box or loading in DOOM does not obviously show impact here, as it shows up on the dashboard of the attacker account rather than the admin account. Since requests can still be made to the admin panel as the admin account, the author decided to upload a malicious plugin using JavaScript. This plugin gives the attacker a reverse shell using the version.php file.

Targeting an administrator using login CSRF (same video as before)

The JavaScript to do this can be found here. It is long and ugly, as well as a bit noisy, and the author does not go through it. It essentially pulls down the plugin.zip file from the attacker's server, and replicates the requests that would be sent if the plugin were to be uploaded through the web interface.

Using the Impersonation Functionality

Initially, Moodle only fixed the CSRF on the login form, though this still allowed the issue to be exploited using Moodle's impersonation functionality instead. Rather than exploiting login CSRF, an attacker would have to convince an administrator to impersonate their account, causing the administrator to view the attacker's dashboard. The exact same scripts are then used to exploit this issue.

Targeting an administrator using the impersonation functionality

Root cause

Two independent weaknesses break that assumption:

  1. The login form had no CSRF protection, so an attacker could force a victim into a session on the attacker's account, and therefore onto the attacker's dashboard.
  2. PHP uses only the first cookie of a given name in the Cookie header, while browsers send cookies with more restrictive paths first. Setting a second MoodleSession cookie scoped to /my/ therefore makes the attacker's session win for dashboard requests only, while the victim's own session continues to be used everywhere else.

Because the victim's real session remains valid for the rest of the site, the script can make requests to the admin panel as the victim, which is what turns the self-XSS into full XSS. The impersonation variant shows that the same outcome is reachable without the login CSRF, so fixing only the CSRF still left the issue exploitable.

Impact

An attacker can run arbitrary JavaScript as a victim user, as with any regular XSS, rather than only obtaining read-only access to the DOM. In the demonstrated case the victim is an administrator, and the script uploads a malicious plugin that gives the attacker a reverse shell on the web server. The attack requires the victim to follow a link from the attacker and then log in to their own account in the same browser, or, in the impersonation variant, to be convinced to impersonate the attacker's account. The author notes that the read-only access obtained from login CSRF alone did not yield anything of great interest on a Moodle installation with minimal extra configurations.

Fix

Moodle's response came in two stages:

  1. The login CSRF was patched in Moodle versions 3.1.15, 3.3.9, 3.4.6 and 3.5.3, with CVE-2018-16854 and MSA-18-0020 assigned.
  2. Moodle then set the forceclean parameter to true when in an impersonated session, to prevent user controlled JavaScript from being included in users' dashboards, in Moodle versions 3.1.17, 3.4.8, 3.5.5 and 3.6.3, with CVE-2019-3847 and MSA-19-0004 assigned.

Variants to test

  • Duplicate cookies with different paths. On any PHP application, set the same session cookie name with a broader path for one account and a narrower path (for example the path of a personal page) for another. A positive result is a request to the narrower path carrying both cookies, with the server acting on the first one.
  • Login forms without CSRF tokens. Check whether a login form can be submitted cross-site. A positive result is a victim being logged in to an attacker-controlled account after visiting a crafted page.
  • Self-only rendering features. Look for features described as visible only to the owner (dashboards, profiles, notes) that accept HTML or scripts. A positive result is stored markup that executes in the application's origin when the page is rendered.
  • Impersonation and "view as" features. If an administrator can impersonate a user, check whether that user's stored content is rendered with the administrator's privileges. A positive result is script from the impersonated account making privileged requests succeed.
  • Cross-domain reads of session values. Where a script fetches a session identifier from an attacker server, check whether the response carries Access-Control-Allow-Origin: * or an equivalent. A positive result is JavaScript on the target origin being able to read the value.

Disclosure timeline

Date Event
2018-08-18 Issue reported to Moodle with details of exploiting using login CSRF.
2018-08-25 Details of exploiting using impersonation functionality added to issue.
2018-10-25 Asked to create a separate ticket for the exploitation using the impersonation functionality.
2018-11-12 Login CSRF patched (Moodle versions 3.1.15, 3.3.9, 3.4.6, 3.5.3). CVE-2018-16854 and MSA-18-0020 assigned.
2019-03-11 Moodle now sets the forceclean parameter to true when in an impersonated session to prevent user controlled JavaScript from being included in users' dashboards (Moodle versions 3.1.17, 3.4.8, 3.5.5, 3.6.3). CVE-2019-3847 and MSA-19-0004 assigned.

Footnotes

  1. Other browsers untested.
  2. The attacker's server must return the header Access-Control-Allow-Origin: * or equivalent along with the result of the cookie.php script to allow the value to be read by JavaScript cross-domain on line 10.
  3. Again this needs to be returned with the Access-Control-Allow-Origin: * header.

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

What happened, in plain words

Moodle is a website that schools and companies use to run online courses. Every person who logs in gets a personal page called a dashboard, a bit like a private noticeboard that only they can see. Moodle let people stick their own HTML blocks on that noticeboard. HTML is the language web pages are written in, and it can include JavaScript, the language that makes pages do things. So a user could put a small program on their own dashboard, and it would run inside the Moodle website.

Normally that is harmless, because only the owner sees their own dashboard. The danger is that the program runs with the website's own trust, so if anyone else ever saw that page, the program would run in their browser too, which is what the attack achieves. Security people call this self-XSS: a cross-site scripting bug that only the person who planted it can trigger. Cross-site scripting (XSS) means getting your own code to run inside someone else's website, as if the site itself had written it.

This write-up shows how the author turned that harmless-looking feature into a real attack. Two small weaknesses made it work. First, the login form had no CSRF protection. CSRF (cross-site request forgery) means tricking a logged-in person's browser into sending a request they did not intend, for example logging them in to an account the attacker controls. Second, the server software Moodle runs on, PHP, and the browsers Chrome and Firefox, disagree slightly about what to do when two cookies have the same name. A cookie is a small piece of text a website asks your browser to keep and send back with every request, like a cloakroom ticket that proves which session is yours. A session is the server's memory of you being logged in.

By planting a second session cookie that only applies to the dashboard address, the author made the victim's browser show the attacker's dashboard while the victim was really logged in as themselves everywhere else. The script on that dashboard then ran with the victim's powers. In the demonstration the victim is an administrator, and the script quietly uploads a malicious plugin, a piece of add-on software, that gives the attacker a shell on the web server. A shell is a command line on someone else's machine.

The video below shows the whole thing. An administrator follows a link the attacker sent. The next time the administrator logs in to their own account in the same browser, JavaScript uploads the malicious plugin and the attacker gets a shell on the web server.

Or watch on YouTube
From the original on medium.com

Targeting an administrator to upload a malicious plugin

Background: what Moodle does and why this looked interesting

The author came across some earlier write-ups about turning self-XSS into something more serious, and then noticed a line in a Moodle security announcement. A security announcement is the public notice a vendor publishes when it fixes a problem. The line said:

Authenticated user[sic] are allowed to add HTML blocks containing scripts to their Dashboard and this is normally not a security issue because personal dashboard is visible to this user only.

"Authenticated user" means someone who has logged in. The announcement is saying: yes, people can put scripts on their dashboard, but only they can see it, so it is fine.

The author's view is that this is more of a feature than a stored self-XSS. Stored means the malicious content is saved on the server and shown again later, rather than being reflected back once. Either way, the situation is the same: users can insert any HTML and JavaScript, it runs in the context of the Moodle domain, and it is supposed to be rendered only in their own browser. "Context of the domain" means the browser treats the code as coming from Moodle itself, so it can do anything a Moodle page could do.

The login form also had no CSRF protection. On its own, that let an attacker get read-only access to any page a victim could view. Read-only means the attacker could read what was on the page but not act as the victim. The author says this did not leak anything of great interest from a Moodle installation with minimal extra configurations, perhaps, he adds, because he did not know Moodle well enough. So the goal became turning it into full XSS, where arbitrary JavaScript runs as the victim user.

The lab setup

The author used a Moodle installation at http://moodle.[redacted]. It had an administrator account called admin and a low privileged account the attacker can log in to, called attacker. Low privileged means it can do very little. There was also a server belonging to the attacker at attacker.[redacted]. All the files used are in the moodle-login-csrf GitHub repository. A repository is a public folder of code.

The technique relies on two behaviours, one on the server and one in the browser. The next two sections explain each.

The trick: two cookies with the same name

The method takes advantage of the way PHP and browsers treat multiple cookies with the same name.

What PHP does

If two session cookies are sent in one request to Moodle, the first session cookie in the Cookie header is used and the second is ignored. A header is a line of extra information sent with a web request or response. The request below shows this. The session cookie highlighted in bold in the original is the one used to identify the logged-in user; the other cookie of the same name is ignored:

HTTP
GET /my/ HTTP/1.1...Cookie: MoodleSession=[redacted]; MoodleSession=[redacted]

Line by line:

  • GET /my/ HTTP/1.1 is the browser asking the server for the page at the address /my/, using version 1.1 of the HTTP protocol, the language browsers and servers speak. /my/ is the address of the user's dashboard in Moodle.
  • ... stands for the other headers that would normally be in the request, which are not shown.
  • Cookie: is the header that carries all the cookies the browser is sending back to this site.
  • MoodleSession=[redacted] is the first session cookie. The long string is the session identifier, a random-looking value that the server uses to look up who is logged in.
  • ; separates one cookie from the next.
  • MoodleSession=[redacted] is a second cookie with exactly the same name but a different value, belonging to a different session.

Because of how PHP handles multiple cookies, only the first one ends up in the $_COOKIE superglobal. A superglobal is PHP's built-in storage for incoming data such as cookies and form fields. So the server acts as the first cookie's user and never notices the second.

What browsers do

Chrome and Firefox (other browsers were not tested) will build a request with duplicate cookies, like the one above, when different values of the same cookie are set with different paths. A path is the part of the address a cookie is limited to. A cookie set for / is sent everywhere on the site; a cookie set for /my/ is sent only to addresses starting with /my/.

Say two cookies are set in the browser:

  • a cookie named MoodleSession with a path of / containing a session identifier associated with Alice's account; and
  • a cookie named MoodleSession with a path of /my/ containing a session identifier associated with Bob's account.

What happens:

  • Requests to paths outside /my/ carry only Alice's session cookie, so the site treats the browser as Alice.
  • Requests to /my/ carry both cookies, because both paths match that address.
  • Both Chrome and Firefox appear to send cookies with more restrictive paths first. Bob's cookie, scoped to /my/, is therefore sent first, and PHP uses it.

So the person using this browser sees the whole site as Alice, except /my/, which shows Bob's dashboard. That is the whole trick: the victim stays logged in as themselves for everything except the one page that holds the attacker's script.

Carrying out the attack

The combination of CSRF on the login form and the double session cookie behaviour gives everything needed to target other users with JavaScript embedded on the attacker's dashboard.

Step 1: prepare the dashboard

First the attacker embeds a script, such as the one from the GitHub repository, in their own dashboard. Part of it is shown in the original. The easiest way to do this is to add a new HTML block and use an intercepting proxy such as BurpSuite. An intercepting proxy is a tool that sits between your browser and the website and lets you see and edit every request before it is sent, which is handy when a form will not let you type raw HTML.

The first stage of the moodle.js script.

The script does the following:

  1. It checks whether a cookie named poisoned is set in the browser. This cookie is just a marker the script leaves behind so it can tell whether it has already run once.
  2. If the marker is not there, it sets the poisoned cookie, then asks the attacker's own server for a session cookie belonging to the attacker account. It gets this from the cookie.php script. It then stores that value in the MoodleSession cookie with a path of /my/.
  3. It then logs out of the attacker account. This logout does not cancel the newly stored session cookie, because logging out involves requests to paths outside /my/, and the new cookie is only sent to /my/.
  4. If the poisoned cookie is already present, the script runs the final XSS payload instead, which is described below.

Why this order matters: the attacker wants the victim's browser to hold a valid session for the attacker's account, but only for the dashboard address, and to keep it after the attacker's own session is closed.

Step 2: lure the victim

The attacker now targets the victim, in this case the owner of the admin account, with a simple login CSRF payload such as the one below. It logs the victim in to the attacker account.

Login CSRF to force a user to be logged in to the 'attacker' account.

What happens next, in order:

  1. The victim opens the attacker's page and their browser is made to log in to the attacker account without them realising.
  2. The victim is shown the dashboard of the attacker account, and the script from step 1 runs in their browser.
  3. The victim's browser now holds the poisoned cookie and a session cookie for the attacker account, scoped to /my/. Then the victim is logged out.
  4. The next time the victim logs in to the admin account in the same browser, everything looks normal. They can browse the whole Moodle installation, including the admin panel, as themselves.
  5. But when they open /my/ to load their dashboard, the browser sends the attacker's session cookie first, so the server returns the attacker's dashboard, script included. Because the poisoned cookie is present, the script now runs its second stage.

Step 3: the final payload

Showing an alert box, or loading the game DOOM into the page, does not obviously show impact here, because it would appear on the attacker's dashboard rather than the admin's. The author wanted something that proves real damage. Since the script can still make requests to the admin panel as the admin account, he chose to upload a malicious plugin using JavaScript. That plugin gives the attacker a reverse shell through its version.php file. A reverse shell is a connection from the victim server back to the attacker, giving the attacker a command line on it.

Targeting an administrator using login CSRF (same video as before)

The JavaScript that does this is linked in the original. The author calls it long and ugly, as well as a bit noisy, and does not go through it. In short, it downloads the plugin.zip file from the attacker's server and repeats the requests that would be sent if the plugin were uploaded through the normal web interface. The point is that the requests come from the victim's browser, carrying the victim's admin session, so the server accepts them.

The second route: impersonation

At first Moodle only fixed the CSRF on the login form. That still left the issue exploitable, using Moodle's impersonation functionality instead. Impersonation, sometimes called "log in as", is a feature that lets an administrator view the site as another user, for support purposes.

Instead of login CSRF, the attacker now has to convince an administrator to impersonate the attacker's account. That makes the administrator view the attacker's dashboard, and the exact same scripts do the rest. The only difference is how the victim is brought to the dashboard.

Targeting an administrator using the impersonation functionality

Why it worked

Two independent weaknesses break that assumption:

  1. The login form had no CSRF protection, so an attacker could force a victim into a session on the attacker's account, and therefore onto the attacker's dashboard.
  2. PHP uses only the first cookie of a given name in the Cookie header, while browsers send cookies with more restrictive paths first. Setting a second MoodleSession cookie scoped to /my/ therefore makes the attacker's session win for dashboard requests only, while the victim's own session keeps being used everywhere else.

Because the victim's real session stays valid for the rest of the site, the script can make requests to the admin panel as the victim. That is what turns the self-XSS into full XSS. The impersonation variant shows the same outcome is reachable without the login CSRF, so fixing only the CSRF still left the issue exploitable.

What an attacker could do

An attacker can run arbitrary JavaScript as a victim user, as with any regular XSS, rather than only getting read-only access to the page. In the demonstrated case the victim is an administrator, and the script uploads a malicious plugin that gives the attacker a reverse shell on the web server. The attack needs the victim to follow a link from the attacker and then log in to their own account in the same browser, or, in the impersonation variant, to be convinced to impersonate the attacker's account. The author notes that the read-only access from login CSRF alone did not yield anything of great interest on a Moodle installation with minimal extra configurations.

How Moodle fixed it

Moodle's response came in two stages:

  1. The login CSRF was patched in Moodle versions 3.1.15, 3.3.9, 3.4.6 and 3.5.3, with CVE-2018-16854 and MSA-18-0020 assigned. A CVE is a public identifier for a known vulnerability; MSA is Moodle's own security announcement numbering.
  2. Moodle then set the forceclean parameter to true when in an impersonated session, to stop user-controlled JavaScript being included in users' dashboards, in Moodle versions 3.1.17, 3.4.8, 3.5.5 and 3.6.3, with CVE-2019-3847 and MSA-19-0004 assigned. A parameter is a setting passed to the software; forceclean is set to true in impersonated sessions to prevent user-controlled JavaScript being included in dashboards.

Things worth testing elsewhere

  • Duplicate cookies with different paths. On any PHP application, set the same session cookie name with a broader path for one account and a narrower path, for example the path of a personal page, for another. A positive result is a request to the narrower path carrying both cookies, with the server acting on the first one.
  • Login forms without CSRF tokens. Check whether a login form can be submitted from another site. A positive result is a victim being logged in to an attacker-controlled account after visiting a crafted page. A CSRF token is a random value added to a form so the server can tell a genuine submission from a forged one.
  • Self-only rendering features. Look for features described as visible only to the owner, such as dashboards, profiles and notes, that accept HTML or scripts. A positive result is stored markup that executes in the application's origin when the page is rendered. Origin means the scheme, host and port of a site, the identity the browser uses to decide what code belongs to whom.
  • Impersonation and "view as" features. If an administrator can impersonate a user, check whether that user's stored content is rendered with the administrator's privileges. A positive result is script from the impersonated account making privileged requests succeed.
  • Cross-domain reads of session values. Where a script fetches a session identifier from an attacker server, check whether the response carries Access-Control-Allow-Origin: * or an equivalent. A positive result is JavaScript on the target origin being able to read the value. CORS, cross-origin resource sharing, is the set of rules that decides whether one site's JavaScript may read another site's response; the header above is the server saying yes to everyone.

Timeline

Date Event
2018-08-18 Issue reported to Moodle with details of exploiting using login CSRF.
2018-08-25 Details of exploiting using impersonation functionality added to issue.
2018-10-25 Asked to create a separate ticket for the exploitation using the impersonation functionality.
2018-11-12 Login CSRF patched (Moodle versions 3.1.15, 3.3.9, 3.4.6, 3.5.3). CVE-2018-16854 and MSA-18-0020 assigned.
2019-03-11 Moodle now sets the forceclean parameter to true when in an impersonated session to prevent user controlled JavaScript from being included in users' dashboards (Moodle versions 3.1.17, 3.4.8, 3.5.5, 3.6.3). CVE-2019-3847 and MSA-19-0004 assigned.

Notes

  1. Other browsers were not tested.
  2. The attacker's server must return the header Access-Control-Allow-Origin: * or equivalent along with the result of the cookie.php script, so JavaScript on another domain can read the value on line 10.
  3. Again this needs to be returned with the Access-Control-Allow-Origin: * header.

Glossary

  • HTML: the language web pages are written in; it describes headings, links, images and other content.
  • JavaScript: the programming language that runs inside web pages and makes them interactive.
  • Dashboard: a personal page in Moodle, at the address /my/, that only its owner is meant to see.
  • Self-XSS: a cross-site scripting bug that only the person who planted the code can trigger, because only they see the page it is on.
  • XSS (cross-site scripting): getting your own code to run inside someone else's website, as if the site itself had written it.
  • CSRF (cross-site request forgery): tricking a logged-in person's browser into sending a request they did not intend, such as logging them in to an account the attacker controls.
  • Login CSRF: a CSRF attack aimed at the login form, forcing the victim into the attacker's account.
  • Cookie: a small piece of text a website asks the browser to keep and send back with every request, used to remember who you are.
  • Session: the server's memory of you being logged in, identified by a session cookie.
  • Session identifier: the random-looking value inside a session cookie that the server uses to look up the session.
  • PHP: the programming language Moodle is written in; it runs on the web server.
  • Superglobal: PHP's built-in storage for incoming data such as cookies and form fields, for example $_COOKIE.
  • Header: a line of extra information sent with a web request or response, such as Cookie.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • Path: the part of a web address a cookie is limited to; a cookie set for /my/ is sent only to addresses starting with /my/.
  • Intercepting proxy: a tool that sits between browser and website and lets you see and edit every request, such as BurpSuite.
  • Plugin: add-on software that extends what a web application can do.
  • Shell: a command line on a machine, letting someone run commands on it.
  • Reverse shell: a connection from the victim server back to the attacker, giving the attacker a command line on it.
  • Impersonation: a feature that lets an administrator view the site as another user, sometimes called "log in as".
  • CVE: a public identifier for a known vulnerability.
  • MSA: Moodle's own numbering for its security announcements.
  • Parameter: a setting passed to software; forceclean makes Moodle clean up HTML before showing it.
  • Origin: the scheme, host and port of a site, the identity the browser uses to decide what code belongs to whom.
  • CORS (cross-origin resource sharing): the rules that decide whether one site's JavaScript may read another site's response.
  • Access-Control-Allow-Origin: the response header a server uses to say which other sites may read its response; * means anyone.
  • Read-only access: being able to read what is on a page but not act as the user.
  • Stored: malicious content saved on the server and shown again later, rather than reflected back once.

More by Daniel Thatcher

View all

5 more disclosed reports, best first.

More from Moodle

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.