NodeBB 1.18.4 - Remote Code Execution With One Shot
NodeBB 1.18.4 contained a path traversal in translation file loading, a wormable XSS via profile export, and an authentication bypass caused by prototype pollution in token verification. An unauthenticated attacker could chain these to achieve remote code execution with a single request.
Published on blog.sonarsource.com
Message forums are used by many companies and open source projects to exchange with their users. NodeBB is the leading JavaScript-based forum solution, having over 12k stars on GitHub.
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.
Context
NodeBB is a JavaScript-based forum solution used by companies and open source projects to run communities around their products. The research here covers NodeBB 1.18.4, and the findings affect every version before 1.18.5. Three separate issues were found and chained together:
- Arbitrary JSON file read via a path traversal in the translation loader (CVE-2021-43788)
- Wormable cross-site scripting through exported profile files (CVE-2021-43787)
- API authentication bypass using inherited object properties as bearer tokens (CVE-2021-43786)
The combined result is remote code execution on a NodeBB server regardless of its configuration, without an account or any prior information about the instance.

The feature at the centre of the first two bugs is internationalisation. NodeBB templates use translation tags of the form [[namespace:key]], where the namespace selects a JSON file and the key selects a property inside it. Tags can appear anywhere on a page and are resolved during rendering, on the server or in the client. For example, [[global:403.title]] resolves to the message Access Denied in language/en-US/global.json for the en-US locale:
{
"403.title": "Access Denied"
}
Setup
The research was done against NodeBB 1.18.4.
Finding it
The translation loader builds a filesystem path from the namespace without checking where the result lands. In src/languages.js the function is:
Languages.get = async function (language, namespace) {
const data = await fs.promises.readFile(
path.join(languagesPath, language, `${namespace}.json`),
'utf8'
);
const parsed = JSON.parse(data) || {};
// [...]
return parsed;
};
The namespace parameter is concatenated into the path with no containment check, so a namespace containing traversal sequences escapes the translation directory. The attacker can read any file on the filesystem that ends in .json and contains valid JSON, and the key part of the tag selects which property is returned.
The obvious target is the application configuration, which is stored as JSON and can hold database credentials or the session secret used to sign and verify cookies. Other JSON files on the host may be equally interesting depending on the operating system.
There is no intended way for a user to supply arbitrary translation tags, but the report identifies one place where user input reaches the renderer: the og:url meta tag. In src/meta/tags.js the current URL's path and query are reflected into the response:
// [...]
const ogUrl = url + (req.originalUrl !== '/' ? stripRelativePath(req.originalUrl) : '');
addIfNotExists(meta, 'property', 'og:url', ogUrl);
// [...]
Special HTML characters are escaped, but the square brackets that delimit a translation tag pass through unchanged. A URL containing a tag therefore gets translated later in the rendering of the response, which turns the path traversal into a readable output channel.
Exploitation
Step 1: read a sensitive JSON file through a translation tag
Craft a URL whose path or query contains a translation tag whose namespace traverses out of the language directory and whose key names the property to return. Because the tag is reflected into og:url and resolved during rendering, the value of the chosen property appears in the response. The report demonstrates reading an instance's session secret this way.

With the session secret, an attacker can sign cookies and impersonate users.
Step 2: plant a payload in a predictable JSON file
NodeBB lets users export their profile, posts and uploaded content. A profile export is written to a JSON file at a predictable path:
build/export/UID_profile.json
UID is the ID of the user who exported. Profile fields accept almost arbitrary content, so the attacker registers an account, puts a JavaScript payload into a profile field, and exports the profile. The payload is now stored in a JSON file whose path the attacker knows.
Step 3: point a translation tag at the exported file
The attacker edits the profile again, this time placing a translation tag that traverses to the exported profile file, using the same path traversal as step 1. Sanitisation happens before translation, so the value substituted for the tag is not sanitised: if the attacker controls the data being translated, they control raw HTML and JavaScript in the page.
Step 4: trigger execution and spread
The payload executes whenever someone views the attacker's profile, or any of their posts if the signature field was used. The attacker can go further and make the payload write itself into the profile of every account that visits, so the XSS spreads from user to user. Since it will eventually reach an administrator, the whole instance can be taken over.
Step 5: bypass API authentication
NodeBB's REST API accepts either cookie authentication or API tokens. Tokens are created by administrators and carry a user ID; a token whose user ID is 0 is a master token, which can act on behalf of any user, including administrators, by setting the _uid query parameter on a request. Tokens are sent as a standard bearer token in the Authorization header.
Verification in 1.18.4 looks like this:
1 Auth.verifyToken = async function (token, done) {
2 let { tokens = [] } = await meta.settings.get('core.api');
3 tokens = tokens.reduce((memo, cur) => {
4 memo[cur.token] = cur.uid;
5 return memo;
6 }, {});
7
8 const uid = tokens[token];
9
10 if (uid !== undefined) {
11 if (parseInt(uid, 10) > 0) {
12 done(null, {
13 uid: uid,
14 });
15 } else {
16 done(null, {
17 master: true,
18 });
19 }
20 } else {
21 done(false);
22 }
23 };
The stored tokens are an array of objects with token and uid properties. Lines 3 to 6 fold them into a plain object keyed by token:
[
{ token: '793a561', uid: 42 },
{ token: '1a444cf', uid: 1337 },
]
// becomes:
{
'793a561': 42,
'1a444cf': 1337,
}
Line 8 looks the supplied token up as a property of that object and line 10 checks only whether the result is undefined. Because the object was created with an object literal, it inherits everything from Object.prototype, including toString and constructor. Supplying one of those names as the bearer token finds an inherited property, so the lookup succeeds. The inherited value is a function or an object, so parseInt yields NaN, which is not greater than 0, and the code takes the master branch with master: true.
An unauthenticated attacker can therefore call any API endpoint as any user by sending _uid in the query string. User ID 1 usually belongs to an administrator, and the members of the Administrator group can also be listed. The whole admin API becomes available, which is enough to reach remote code execution. The report deliberately omits the final RCE construction, noting only that it requires a single request.
Root cause
Three distinct mistakes combine:
- The translation loader joins user-influenced input into a path and never verifies that the result stays inside the language directory.
path.joinnormalises the path, but nothing compares it against the base directory. - Translation output is inserted after sanitisation, so any attacker-controlled data that reaches a translation tag is rendered as raw HTML and JavaScript. The
og:urlreflection passes square brackets through, and profile exports give the attacker a JSON file at a known path to point a tag at. - Token verification uses a plain object as a lookup table and tests presence with
!== undefined. Inherited prototype properties are therefore accepted as valid tokens, and their non-numeric values fall into the master-token branch.
Impact
On any NodeBB instance before 1.18.5 that is reachable from the internet, an attacker with no account and no prior knowledge can read arbitrary JSON files, including configuration and the session secret; run a self-spreading XSS that takes over accounts until it reaches an administrator; and bypass API authentication entirely to act as any user. The end result is remote code execution on the server regardless of configuration. The report does not detail the final RCE construction, noting only that it requires a single request.
Fix
The path traversal was fixed by normalising the path and checking that it starts with the language directory:
Languages.get = async function (language, namespace) {
const pathToLanguageFile = path.join(languagesPath, language, `${namespace}.json`);
if (!pathToLanguageFile.startsWith(languagesPath)) {
throw new Error('[[error:invalid-path]]');
}
// ...
}
Because path.join normalises, a simple startsWith check is sufficient to keep the result inside the correct folder. The XSS was partly fixed by this, since the traversal could no longer control a translation's result, and the maintainers also removed the ability to use translation tags in profile fields, reducing the attack surface further.
The authentication bypass was fixed by dropping the array-to-object conversion and searching the array directly:
Auth.verifyToken = async function (token, done) {
const { tokens = [] } = await meta.settings.get('core.api');
const tokenObj = tokens.find(t => t.token === token);
const uid = tokenObj ? tokenObj.uid : undefined;
// ...
};
To limit the impact of similar bugs in future, the maintainers also secured the API endpoint that allowed code execution on the server. NodeBB 1.18.5 was released on 2021-10-27, two days after the report.
Variants to test
- Any feature that builds a filesystem path from a user-supplied name: try traversal sequences in the name and look for content from outside the intended directory. A positive result is a response containing data from a file you know exists elsewhere.
- Template or translation engines that substitute values after escaping: look for reflections of user input into tags or placeholders. A positive result is your markup rendered unescaped.
- Export or backup features that write user-controlled data to a predictable path: check whether the path is guessable and whether the file can later be included or fetched. A positive result is your payload stored and retrievable at a path you predicted.
- Token or session lookups that use a plain object as a map and test with
!== undefined: sendtoString,constructor,valueOfor__proto__as the token. - Master-token designs that accept a user ID parameter: after any bypass, try
_uid=1or enumerate administrator group members. A positive result is an admin-level response.
What happened, in plain words
NodeBB is a piece of software that lets a group of people run an online forum: a website with categories, threads, posts, user profiles and private messages. It is written in JavaScript, the same language that runs inside web browsers, and it is popular with companies and open source projects that want a place for their users to talk. The research described here looked at version 1.18.4 of NodeBB and found three separate security problems. Every version before 1.18.5 is affected.
The three problems are:
- A way to make the server hand over the contents of files it should keep to itself, as long as those files are JSON (a common text format for storing settings and data). This is tracked as CVE-2021-43788.
- A way to slip JavaScript into a page so that it runs in the browser of anyone who views it, and then copies itself from account to account. This is tracked as CVE-2021-43787.
- A way to skip the login check on NodeBB's programming interface (its API) entirely and act as any user, including an administrator. This is tracked as CVE-2021-43786.
A CVE is a public catalogue number for a known security flaw, so that people can look it up and track fixes. The three flaws can be combined, and the combined result is that an attacker can run their own commands on the server that hosts the forum. That is called remote code execution, or RCE: the attacker is not sitting at the machine, but their instructions end up being executed by it. The report stresses that this works regardless of how the instance is configured, and that the attacker needs no account and no prior information about the site. Any NodeBB instance reachable from the internet is a target.

The feature at the centre of the first two bugs is internationalisation, usually shortened to i18n (the letters between the first "i" and the last "n", with 18 letters in between). It is how a piece of software shows its interface in many languages. Instead of writing the words "Access Denied" directly into a page, NodeBB writes a short placeholder, called a translation tag, and looks up the real words for the visitor's language when the page is built. A tag looks like [[namespace:key]]. The namespace picks which file to look in, and the key picks which entry inside that file. Tags can appear anywhere on a page and are resolved while the page is being rendered, either on the server before it is sent or in the browser afterwards.
For example, the tag [[global:403.title]] resolves to the message Access Denied in the file language/en-US/global.json when the visitor's language setting (the locale) is en-US:
{
"403.title": "Access Denied"
}
This is a small JSON file. The curly braces hold a list of name-and-value pairs. The name 403.title is the key, and the text Access Denied is the value. When NodeBB meets the tag [[global:403.title]], it opens the file named by the namespace (global), finds the entry named by the key (403.title), and puts the value in the page.
Setup
The research was done against NodeBB 1.18.4.
Finding it
The file read (CVE-2021-43788)
The translation loader is the piece of code that turns a namespace into an actual file on disk. It builds a file path from the namespace without checking where the result ends up. In src/languages.js the function is:
Languages.get = async function (language, namespace) {
const data = await fs.promises.readFile(
path.join(languagesPath, language, `${namespace}.json`),
'utf8'
);
const parsed = JSON.parse(data) || {};
// [...]
return parsed;
};
Line by line:
Languages.get = async function (language, namespace) {defines a function calledgetthat takes two inputs: the language and the namespace.asyncmeans it does work that takes time (reading a file) and hands back a promise, a placeholder for a result that arrives later.const data = await fs.promises.readFile(starts reading a file.awaitmeans "wait here until the reading is finished, then continue".fsis Node.js's file system module, the part of the runtime that talks to the disk.path.join(languagesPath, language,${namespace}.json),builds the path by gluing three pieces together with the correct separator for the operating system: the base folder where translations live, the language, and the namespace with.jsonappended. The${...}syntax inserts the value of a variable into a string.'utf8'says the file should be read as text.);closes the call.const parsed = JSON.parse(data) || {};turns the text into a JavaScript object. If parsing produces nothing usable, it falls back to an empty object{}.// [...]marks code left out of the excerpt.return parsed;hands the object back to the caller.};closes the function.
The problem is the namespace input. It is pasted into the path with no check that the finished path still points inside the translations folder. A path is just a sequence of folder names separated by slashes, and two dots (..) mean "go up one folder". So a namespace containing .. sequences can climb out of the translations folder and reach files elsewhere on the disk. This kind of flaw is called path traversal: the attacker uses the way paths are written to travel outside the area they are allowed to see. A simple comparison: a hotel clerk who is told "room 12" and walks down the corridor is fine, but if a guest can say "room 12, then out the back door, then the manager's office", the clerk will obediently go there unless someone checks the destination.
The attacker can read any file on the machine that ends in .json and contains valid JSON. The key part of the tag then selects which property of that file is returned, so the attacker can pick out one value rather than the whole file.
The obvious target is the application's configuration, which is stored as JSON and can hold database credentials (the username and password for the database) or the session secret. A session secret is a long random string the server uses to sign and verify cookies. A cookie is a small piece of data a website asks your browser to store and send back with every request; NodeBB uses one to remember that you are logged in. The signature is what stops someone from editing their cookie to claim to be another user, and the secret is the key used to make that signature. If the secret leaks, the attacker can produce correctly signed cookies for any user. Other JSON files on the host may be equally interesting, depending on the operating system.
There is no intended way for a user to supply arbitrary translation tags, but the report identifies one place where user input reaches the renderer: the og:url meta tag. Meta tags are lines in a page's HTML that describe the page to other software, for example the preview card shown when a link is shared on a social network. og:url is meant to hold the page's own address. In src/meta/tags.js the current URL's path and query are reflected into the response:
// [...]
const ogUrl = url + (req.originalUrl !== '/' ? stripRelativePath(req.originalUrl) : '');
addIfNotExists(meta, 'property', 'og:url', ogUrl);
// [...]
Line by line:
// [...]marks code left out.const ogUrl = url + (...)builds the value for the tag.urlis the site's base address. The part in brackets is added only when the requested address is not just/.req.originalUrl !== '/'checks whether the visitor asked for something other than the site root.reqis the incoming request;originalUrlis the address the visitor asked for.stripRelativePath(req.originalUrl)removes a leading relative part from that address.: ''means: if the visitor did ask for the root, add nothing.addIfNotExists(meta, 'property', 'og:url', ogUrl);writes the result into the page's meta tags, unless anog:urltag is already there.
Special HTML characters such as < and > are escaped, meaning they are replaced with harmless codes so they cannot start new HTML. But the square brackets that delimit a translation tag pass through unchanged. So a URL containing a tag gets translated later, while the response is being rendered. That turns the path traversal into a readable output channel: the attacker puts a tag in the URL, the tag points at a file outside the translations folder, and the value of the chosen property appears in the page the attacker receives.
Exploitation
Step 1: read a sensitive JSON file through a translation tag
The attacker crafts a URL whose path or query contains a translation tag. The namespace part of the tag uses .. sequences to climb out of the language directory, and the key part names the property to return. Because the tag is reflected into og:url and resolved during rendering, the value of the chosen property appears in the response. The report demonstrates reading an instance's session secret this way.

With the session secret in hand, an attacker can sign cookies and impersonate users.
Step 2: plant a payload in a predictable JSON file
NodeBB lets users export their profile, their posts and their uploaded content. An export is a download of your own data in a machine-readable form. When a profile is exported, the data is written into a JSON file at a predictable path:
build/export/UID_profile.json
UID is the ID number of the user who exported. "Predictable" is the key word: the attacker knows exactly where the file will be, because the only unknown part is a number they already know (their own user ID).
Profile fields accept almost arbitrary content, so the attacker registers an ordinary account, puts a JavaScript payload into a profile field, and exports the profile. A payload here means a piece of text that, when it later lands in a web page, is treated as code by the browser rather than as text. The payload is now stored in a JSON file whose path the attacker knows.
Step 3: point a translation tag at the exported file
The attacker edits the profile again, this time placing a translation tag that traverses to the exported profile file, using the same path traversal as step 1. The order of operations matters: the page is sanitised (cleaned of anything dangerous) before translation happens. So the value that gets substituted for the tag is never sanitised. If the attacker controls the data being translated, they control raw HTML and JavaScript in the page. This is the cross-site scripting flaw, usually shortened to XSS: a site ends up sending code written by an attacker to other people's browsers, and those browsers run it as if the site itself had written it.
Step 4: trigger execution and spread
The payload executes whenever someone views the attacker's profile, or any of their posts if the signature field was used. A signature is the small block of text some forums show under every post a user makes, which makes it a very effective place to put something that should run on many pages. The attacker can go further and make the payload write itself into the profile of every account that visits, so the XSS spreads from user to user, like a worm. A worm is malicious code that copies itself from one victim to the next without the attacker doing anything more. Since it will eventually reach an administrator, the whole instance can be taken over.
Step 5: bypass API authentication
An API is the part of a website that other programs talk to, rather than people clicking in a browser. It is a set of addresses, called endpoints, that accept requests and return data. NodeBB's REST API accepts either cookie authentication, meaning the usual login session, or API tokens. A token is a long random string that acts like a password for a program: whoever holds it can make requests as the user it belongs to, without logging in through a browser. Tokens are created by administrators and carry a user ID. A token whose user ID is 0 is a master token, which can act on behalf of any user, including administrators, by setting the _uid query parameter on a request. A query parameter is the name=value part after the ? in a URL. Tokens are sent as a standard bearer token in the Authorization header. A header is an extra line of information sent with a request; "bearer" simply means "whoever carries this token is treated as the owner".
Verification in 1.18.4 looks like this:
1 Auth.verifyToken = async function (token, done) {
2 let { tokens = [] } = await meta.settings.get('core.api');
3 tokens = tokens.reduce((memo, cur) => {
4 memo[cur.token] = cur.uid;
5 return memo;
6 }, {});
7
8 const uid = tokens[token];
9
10 if (uid !== undefined) {
11 if (parseInt(uid, 10) > 0) {
12 done(null, {
13 uid: uid,
14 });
15 } else {
16 done(null, {
17 master: true,
18 });
19 }
20 } else {
21 done(false);
22 }
23 };
Line by line:
- Line 1 defines
verifyToken, the function that checks a supplied token. It takes the token and adonecallback, which is how the function reports its answer. - Line 2 loads the stored token settings from the
core.apisettings group. If nothing is stored,tokensbecomes an empty list[]. - Lines 3 to 6 turn that list into a lookup table.
reducewalks the list one item at a time, carrying an accumulator calledmemo. For each itemcur, line 4 storesmemo[cur.token] = cur.uid, meaning "under the name of this token, remember this user ID". Line 5 hands the accumulator to the next round. Line 6 starts the accumulator as an empty object{}. - Line 8 looks up the supplied token as a property name on that object and stores the result in
uid. - Line 10 checks only whether the result is
undefined, which is JavaScript's way of saying "nothing here". - Lines 11 to 19 decide what kind of token it is.
parseInt(uid, 10)reads the value as a whole number in base 10. If it is greater than 0, lines 12 to 14 report a normal token with that user ID. Otherwise lines 16 to 18 report a master token. - Lines 20 to 22 report failure when the lookup found nothing.
- Line 23 closes the function.
The stored tokens are a list of objects with token and uid properties. Lines 3 to 6 fold them into a plain object keyed by token:
[
{ token: '793a561', uid: 42 },
{ token: '1a444cf', uid: 1337 },
]
// becomes:
{
'793a561': 42,
'1a444cf': 1337,
}
This shows the shape change. On the left is a list of two records, each with a token and a user ID. On the right is a single object where each token is now a name and each user ID is its value. Looking up a token is then just asking the object for the property with that name.
Line 8 looks the supplied token up as a property of that object, and line 10 checks only whether the result is undefined. Here is the flaw. In JavaScript, every object made with {} automatically inherits a set of built-in properties from something called Object.prototype, the shared template that all plain objects are based on. Two of those inherited names are toString and constructor. They are not tokens anyone created, but they exist on every plain object. Supplying one of those names as the bearer token finds an inherited property, so the lookup succeeds and the check on line 10 passes. The inherited value is a function or an object, not a number, so parseInt yields NaN, which stands for "not a number". NaN is not greater than 0, so the code takes the master branch and sets master: true.
An unauthenticated attacker can therefore call any API endpoint as any user by sending _uid in the query string. User ID 1 usually belongs to an administrator, and the members of the Administrator group can also be listed. The whole admin API becomes available, which is enough to reach remote code execution. The report deliberately omits the final RCE construction, noting only that it requires a single request.
Root cause
Three distinct mistakes combine:
- The translation loader joins user-influenced input into a path and never verifies that the result stays inside the language directory.
path.joinnormalises the path, meaning it tidies up..sequences into a clean final path, but nothing compares that final path against the base directory. - Translation output is inserted after sanitisation, so any attacker-controlled data that reaches a translation tag is rendered as raw HTML and JavaScript. The
og:urlreflection passes square brackets through, and profile exports give the attacker a JSON file at a known path to point a tag at. - Token verification uses a plain object as a lookup table and tests presence with
!== undefined. Inherited prototype properties are therefore accepted as valid tokens, and their non-numeric values fall into the master-token branch.
Impact
On any NodeBB instance before 1.18.5 that is reachable from the internet, an attacker with no account and no prior knowledge can read arbitrary JSON files, including configuration and the session secret; run a self-spreading XSS that takes over accounts until it reaches an administrator; and bypass API authentication entirely to act as any user. The end result is remote code execution on the server regardless of configuration. The report does not detail the final RCE construction, noting only that it requires a single request.
Fix
The path traversal was fixed by normalising the path and checking that it starts with the language directory:
Languages.get = async function (language, namespace) {
const pathToLanguageFile = path.join(languagesPath, language, `${namespace}.json`);
if (!pathToLanguageFile.startsWith(languagesPath)) {
throw new Error('[[error:invalid-path]]');
}
// ...
}
Line by line:
- The first line defines the same function as before.
- The second line builds the path exactly as before, but stores it in a named variable,
pathToLanguageFile, so it can be inspected before being used. - The third line is the new guard.
startsWith(languagesPath)asks whether the finished path begins with the translations folder. The!means "if it does not". - The fourth line throws an error, refusing the request, when the check fails.
- The rest of the function is unchanged.
Because path.join normalises, a simple startsWith check is sufficient to keep the result inside the correct folder. The XSS was partly fixed by this, since the traversal could no longer control a translation's result, and the maintainers also removed the ability to use translation tags in profile fields, reducing the attack surface further. Attack surface means the total set of ways an attacker can reach the system.
The authentication bypass was fixed by dropping the array-to-object conversion and searching the array directly:
Auth.verifyToken = async function (token, done) {
const { tokens = [] } = await meta.settings.get('core.api');
const tokenObj = tokens.find(t => t.token === token);
const uid = tokenObj ? tokenObj.uid : undefined;
// ...
};
Line by line:
- The first line defines the same function.
- The second line loads the stored tokens as before.
- The third line searches the list for an entry whose
tokenproperty exactly equals the supplied token.findreturns the matching entry, or nothing if there is no match. There is no object and therefore no inherited properties to stumble into. - The fourth line takes the user ID from the found entry, or sets it to
undefinedwhen nothing was found. The? :form means "if there is an entry, use its uid; otherwise use undefined". - The rest of the function is unchanged.
To limit the impact of similar bugs in future, the maintainers also secured the API endpoint that allowed code execution on the server. NodeBB 1.18.5 was released on 2021-10-27, two days after the report.
Variants to test
These are the general lessons, written as things to try on other software:
- Any feature that builds a filesystem path from a user-supplied name: try traversal sequences in the name and look for content from outside the intended directory. A positive result is a response containing data from a file you know exists elsewhere.
- Template or translation engines that substitute values after escaping: look for reflections of user input into tags or placeholders. A positive result is your markup rendered unescaped.
- Export or backup features that write user-controlled data to a predictable path: check whether the path is guessable and whether the file can later be included or fetched. A positive result is your payload stored and retrievable at a path you predicted.
- Token or session lookups that use a plain object as a map and test with
!== undefined: sendtoString,constructor,valueOfor__proto__as the token. - Master-token designs that accept a user ID parameter: after any bypass, try
_uid=1or enumerate administrator group members. A positive result is an admin-level response.
Glossary
- API: the part of a website that other programs talk to, made of addresses called endpoints that accept requests and return data.
- Authentication: proving who you are to a system, usually by logging in.
- Authorization header: an extra line sent with a request that carries credentials, such as a bearer token.
- Bearer token: a token where possession alone is enough to be treated as its owner, like a ticket that is not checked against a name.
- Callback: a function passed to another function so it can report its result when it is finished.
- Cookie: a small piece of data a website asks your browser to store and send back with every request, often used to remember that you are logged in.
- Cross-site scripting (XSS): a flaw where a site sends code written by an attacker to other people's browsers, which run it as if the site had written it.
- CVE: a public catalogue number for a known security flaw.
- Endpoint: one address of an API, for example the address that lists users or the one that creates a post.
- Escaping: replacing characters that have special meaning in HTML with harmless codes so they are shown as text instead of being acted on.
- Header: an extra line of information sent with a web request or response.
- HTML: the language web pages are written in, made of tags that describe structure and content.
- i18n (internationalisation): designing software so its interface can be shown in many languages.
- JavaScript: the programming language that runs inside web browsers and, through Node.js, on servers.
- JSON: a text format for storing data as name-and-value pairs inside curly braces, and lists inside square brackets.
- Locale: the language and regional setting a visitor has chosen, such as
en-US. - Master token: an API token that is allowed to act on behalf of any user, including administrators.
- Meta tag: a line in a page's HTML that describes the page to other software, such as the preview shown when a link is shared.
- NaN: JavaScript's value for "not a number", produced when something that is not numeric is read as a number.
- Node.js: a program that lets JavaScript run outside the browser, for example on a web server.
- Object.prototype: the shared template that all plain JavaScript objects are based on, which gives every object built-in properties such as
toStringandconstructor. - Path traversal: using the way file paths are written, especially
..meaning "go up one folder", to reach files outside the area you are allowed to see. - Payload: the piece of attacker-written content that does the damage when it is processed, for example JavaScript that a browser will run.
- Promise: a placeholder for a result that will arrive later, used for work that takes time such as reading a file.
- Query parameter: the
name=valuepart after the?in a URL. - Reflection: when input from a request is placed back into the response.
- Remote code execution (RCE): a flaw that lets an attacker make a server run their own instructions, without sitting at the machine.
- Render: to build the final page, either on the server before sending it or in the browser afterwards.
- REST API: an API organised around addresses that represent things, where the kind of request (read, create, change, delete) says what to do.
- Sanitisation: cleaning input of anything dangerous before it is used or displayed.
- Session secret: a long random string a server uses to sign and verify cookies, so they cannot be edited to claim another identity.
- Signature: a value computed with a secret key that proves a piece of data has not been altered.
- Token: a long random string that acts like a password for a program, letting it make requests as the user it belongs to.
- Translation tag: a placeholder such as
[[namespace:key]]that is replaced with the right words for the visitor's language when a page is rendered. - UID: a user ID, the number that identifies an account.
- Worm: malicious code that copies itself from one victim to the next without further action by the attacker.
- XSS: see cross-site scripting.