Skip to content

QA-CYP-003 — Cypress config disables chromeWebSecurity ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-CYP-003.

FieldValue
Severityerror
Confidencehigh
Tierquarantine
Measured FP rate0% (n=10)
Evidence levelE2
QA impactFalse-green risk (FALSE-GREEN)
False-positive risk (author estimate)low
Autofix availableno
Languagestypescript, javascript
Frameworkscypress
Detection strategyLEXICAL (positive match on chromeWebSecurity:false inside cypress.config.* (the config is the artifact — no heuristic))
Introduced inv0.6.0

Why this fails in production ​

chromeWebSecurity: false in cypress.config.* runs the entire Cypress suite against a browser with its same-origin policy turned off. The tests stop exercising the security boundary the browser enforces in production: cross-origin frames, cookies, and requests that the app's users could never make from that origin succeed inside the test run, so a real cross-origin breakage ships unnoticed while the suite stays green. It also widens the attack surface of every site the tests visit — a malicious ad/CDN script loaded during testing can read cookies from other origins.

What gets flagged (real detector output) ​

`chromeWebSecurity: false` disables the browser's same-origin policy for every test.

Example from this rule's own must-fire fixture: tests/fixtures/QA-CYP-003/must-fire/cypress.config.js

The fix ​

Keep chromeWebSecurity enabled (the default); scope the cross-origin work to cy.origin()/cy.session() instead.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-CYP-003/must-not-fire/cypress.config.js — a legitimate, similar-looking pattern this rule correctly leaves alone.

Corpus-measured false-positive risk ​

Real occurrence counts from npm run corpus:audit against actively-maintained OSS repos — reproduce yourself, don't just trust this table (see the false-positive audit):

RepoOccurrences
appsmithorg-appsmith1
positive-fixtures1

Released under the MIT License.