From 506031943719b98f74757af5586a0727ac338338 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Mon, 6 Oct 2025 13:58:39 +0200 Subject: [PATCH 1/3] support/crate-report-form: Split `security` checkbox into `malicious-code` and `vulnerability` --- app/components/support/crate-report-form.gjs | 6 +++++- e2e/acceptance/support.spec.ts | 4 ++++ tests/acceptance/support-test.js | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/components/support/crate-report-form.gjs b/app/components/support/crate-report-form.gjs index 926c972f01a..9fa88e8092e 100644 --- a/app/components/support/crate-report-form.gjs +++ b/app/components/support/crate-report-form.gjs @@ -24,7 +24,11 @@ const REASONS = [ description: 'it is abusive or otherwise harmful', }, { - reason: 'security', + reason: 'malicious-code', + description: 'it contains malicious code', + }, + { + reason: 'vulnerability', description: 'it contains a vulnerability (please try to contact the crate author first)', }, { diff --git a/e2e/acceptance/support.spec.ts b/e2e/acceptance/support.spec.ts index 95a52f9552c..790f302dabc 100644 --- a/e2e/acceptance/support.spec.ts +++ b/e2e/acceptance/support.spec.ts @@ -130,6 +130,7 @@ test.describe('Acceptance | support page', { tag: '@acceptance' }, () => { - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [ ] it is violating the usage policy in some other way (please specify below) @@ -174,6 +175,7 @@ Additional details: - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [x] it is violating the usage policy in some other way (please specify below) @@ -263,6 +265,7 @@ test detail - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [ ] it is violating the usage policy in some other way (please specify below) @@ -303,6 +306,7 @@ Additional details: - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [x] it is violating the usage policy in some other way (please specify below) diff --git a/tests/acceptance/support-test.js b/tests/acceptance/support-test.js index 18355e1c6db..7882c1e7d7f 100644 --- a/tests/acceptance/support-test.js +++ b/tests/acceptance/support-test.js @@ -144,6 +144,7 @@ module('Acceptance | support', function (hooks) { - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [ ] it is violating the usage policy in some other way (please specify below) @@ -181,6 +182,7 @@ Additional details: - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [x] it is violating the usage policy in some other way (please specify below) @@ -292,6 +294,7 @@ test detail - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [ ] it is violating the usage policy in some other way (please specify below) @@ -327,6 +330,7 @@ Additional details: - [x] it contains spam - [ ] it is name-squatting (reserving a crate name without content) - [ ] it is abusive or otherwise harmful +- [ ] it contains malicious code - [ ] it contains a vulnerability (please try to contact the crate author first) - [x] it is violating the usage policy in some other way (please specify below) From 38ab4869024548a8471c7b8c740c9ce734ce6314 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Mon, 6 Oct 2025 13:59:26 +0200 Subject: [PATCH 2/3] support/crate-report-form: Send malicious code reports to `security@rust-lang.org` too --- app/components/support/crate-report-form.gjs | 25 ++++-- e2e/acceptance/support.spec.ts | 80 ++++++++++++++------ tests/acceptance/support-test.js | 75 ++++++++++++------ 3 files changed, 129 insertions(+), 51 deletions(-) diff --git a/app/components/support/crate-report-form.gjs b/app/components/support/crate-report-form.gjs index 9fa88e8092e..1c534a38abd 100644 --- a/app/components/support/crate-report-form.gjs +++ b/app/components/support/crate-report-form.gjs @@ -80,6 +80,10 @@ export default class CrateReportForm extends Component { this.reasonsInvalid = false; } + get isMaliciousCodeReport() { + return this.selectedReasons.includes('malicious-code'); + } + @action submit() { if (!this.validate()) { @@ -91,7 +95,7 @@ export default class CrateReportForm extends Component { } composeMail() { - let crate = this.crate; + let { crate, isMaliciousCodeReport } = this; let reasons = this.reasons .map(({ reason, description }) => { let selected = this.isReasonSelected(reason); @@ -107,9 +111,16 @@ Additional details: ${this.detail} `; let subject = `The "${crate}" crate`; - let address = 'help@crates.io'; - let mailto = `mailto:${address}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`; - return mailto; + if (isMaliciousCodeReport) { + subject = `[SECURITY] ${subject}`; + } + + let addresses = 'help@crates.io'; + if (isMaliciousCodeReport) { + addresses += ',security@rust-lang.org'; + } + + return `mailto:${addresses}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`; }