Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions src/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,53 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('eslint-config-etherpad/patch/modern-module-resolution');

// The recommended rule sets of the Interlace security plugins. Rules that do not fit this code
// today are turned off in the override below, each with its reason.
const recommended = (name) => require(`eslint-plugin-${name}`).configs.recommended.rules;

module.exports = {
ignorePatterns: [
'/static/js/vendors/browser.js',
'/static/js/vendors/farbtastic.js',
'/static/js/vendors/gritter.js',
'/static/js/vendors/html10n.js',
'/static/js/vendors/jquery.js',
'/static/js/vendors/jquery.ts',
'/static/js/vendors/nice-select.js',
// Minified third-party bundle; the security rules overflow the stack on it.
'/static/vendor/',
'/tests/frontend/lib/',
],
overrides: [
{
files: [
'**/*',
],
excludedFiles: [
'**/.eslintrc.*',
],
plugins: ['node-security', 'express-security', 'secure-coding'],
rules: {
...recommended('node-security'),
...recommended('express-security'),
...recommended('secure-coding'),
// node-security
'node-security/no-arbitrary-file-access': 'off', // admin routes read paths from the settings file
'node-security/no-toctou-vulnerability': 'off', // check-then-use on files the server itself owns
'node-security/detect-eval-with-expression': 'off', // a Playwright test evaluates a fixed string
// express-security
'express-security/require-express-body-parser-limits': 'off', // limits are set where the parsers are mounted
'express-security/no-host-header-in-links': 'off', // links use the configured base URL, Host only as fallback
'express-security/no-permissive-trust-proxy': 'off', // trustProxy is an opt-in setting for reverse proxies
'express-security/no-exposed-debug-endpoints': 'off', // matches /stats and update-status routes, which are gated
'express-security/no-insecure-cookie-options': 'off', // cookie flags follow the request's secure state
// secure-coding
'secure-coding/no-unlimited-resource-allocation': 'off', // the admin read is bounded by the settings file
'secure-coding/no-log-injection': 'off', // logged values are escaped by the logger
'secure-coding/no-redos-vulnerable-regex': 'off', // the regex runs on sanitiser input of bounded size
'secure-coding/no-sensitive-data-exposure': 'off', // test fixtures contain token-like strings on purpose
},
},
{
files: [
'**/.eslintrc.*',
Expand Down
3 changes: 3 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
"chokidar": "^6.0.0",
"eslint": "^10.15.0",
"eslint-config-etherpad": "^5.0.3",
"eslint-plugin-express-security": "^4.4.3",
"eslint-plugin-node-security": "^6.3.8",
"eslint-plugin-secure-coding": "^6.5.7",
"etherpad-cli-client": "^4.0.3",
"mocha": "12.0.3",
"mocha-froth": "^0.2.10",
Expand Down
Loading