@critiq/rules 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -4
- package/catalog.yaml +985 -19
- package/package.json +6 -1
- package/rules/go/go.performance.no-regex-construction-in-loop.rule.yaml +33 -0
- package/rules/go/go.performance.no-sync-fs-in-request-path.rule.yaml +33 -0
- package/rules/go/go.performance.no-unbounded-concurrency.rule.yaml +33 -0
- package/rules/go/go.security.echo-sensitive-binding-without-validation.rule.yaml +46 -0
- package/rules/go/go.security.echo-unsafe-multipart-upload.rule.yaml +45 -0
- package/rules/go/go.security.fiber-sensitive-binding-without-validation.rule.yaml +45 -0
- package/rules/go/go.security.fiber-unsafe-multipart-upload.rule.yaml +45 -0
- package/rules/go/go.security.gin-sensitive-binding-without-validation.rule.yaml +45 -0
- package/rules/go/go.security.gin-trust-all-proxies.rule.yaml +45 -0
- package/rules/go/go.security.gin-wildcard-cors-with-credentials.rule.yaml +47 -0
- package/rules/go/go.security.net-http-missing-timeouts.rule.yaml +45 -0
- package/rules/go/go.security.sensitive-data-egress.rule.yaml +46 -0
- package/rules/go/go.security.tar-path-traversal.rule.yaml +45 -0
- package/rules/go/go.security.template-unescaped-request-value.rule.yaml +45 -0
- package/rules/go/go.testing.real-network-in-unit-test.rule.yaml +33 -0
- package/rules/go/go.testing.t-skip-without-ticket-reference.rule.yaml +33 -0
- package/rules/go/go.testing.time-sleep-in-unit-test.rule.yaml +33 -0
- package/rules/java/java.performance.no-regex-construction-in-loop.rule.yaml +33 -0
- package/rules/java/java.performance.no-sync-fs-in-request-path.rule.yaml +33 -0
- package/rules/java/java.performance.no-unbounded-concurrency.rule.yaml +33 -0
- package/rules/java/java.security.android-screenshot-exposure.rule.yaml +35 -0
- package/rules/java/java.security.android-world-readable-mode.rule.yaml +35 -0
- package/rules/java/java.security.jpa-concatenated-query.rule.yaml +47 -0
- package/rules/java/java.security.reflected-output-from-request.rule.yaml +35 -0
- package/rules/java/java.security.servlet-insecure-cookie.rule.yaml +35 -0
- package/rules/java/java.security.spring-actuator-health-details-always.rule.yaml +40 -0
- package/rules/java/java.security.spring-actuator-sensitive-exposure.rule.yaml +40 -0
- package/rules/java/java.security.spring-csrf-globally-disabled.rule.yaml +49 -0
- package/rules/java/java.security.spring-debug-exposure.rule.yaml +35 -0
- package/rules/java/java.security.spring-permit-all-default.rule.yaml +47 -0
- package/rules/java/java.security.spring-webmvc-unrestricted-data-binding.rule.yaml +47 -0
- package/rules/java/java.security.template-unescaped-user-output.rule.yaml +49 -0
- package/rules/java/java.testing.disabled-without-ticket-reference.rule.yaml +33 -0
- package/rules/java/java.testing.http-client-in-unit-test.rule.yaml +33 -0
- package/rules/java/java.testing.thread-sleep-in-unit-test.rule.yaml +33 -0
- package/rules/php/php.performance.no-regex-construction-in-loop.rule.yaml +33 -0
- package/rules/php/php.performance.no-sync-fs-in-request-path.rule.yaml +33 -0
- package/rules/php/php.performance.no-unbounded-concurrency.rule.yaml +33 -0
- package/rules/php/php.security.insecure-cors-wildcard-with-credentials.rule.yaml +41 -0
- package/rules/php/php.security.insecure-mail-or-file-transport.rule.yaml +41 -0
- package/rules/php/php.security.insecure-session-or-cookie-config.rule.yaml +42 -0
- package/rules/php/php.security.laravel-sensitive-csrf-exclusion.rule.yaml +42 -0
- package/rules/php/php.security.laravel-unsafe-blade-output.rule.yaml +42 -0
- package/rules/php/php.security.laravel-unsafe-mass-assignment.rule.yaml +45 -0
- package/rules/php/php.security.sensitive-data-egress.rule.yaml +42 -0
- package/rules/php/php.security.symfony-csrf-disabled.rule.yaml +42 -0
- package/rules/php/php.security.symfony-debug-exposure.rule.yaml +44 -0
- package/rules/php/php.security.unsafe-file-upload-handling.rule.yaml +41 -0
- package/rules/php/php.security.wordpress-missing-nonce-or-capability.rule.yaml +42 -0
- package/rules/php/php.security.wordpress-unprepared-sql.rule.yaml +42 -0
- package/rules/php/php.testing.curl-in-unit-test.rule.yaml +33 -0
- package/rules/php/php.testing.mark-test-skipped-without-ticket-reference.rule.yaml +33 -0
- package/rules/php/php.testing.sleep-in-unit-test.rule.yaml +33 -0
- package/rules/python/py.performance.no-regex-construction-in-loop.rule.yaml +33 -0
- package/rules/python/py.performance.no-sync-fs-in-request-path.rule.yaml +33 -0
- package/rules/python/py.performance.no-unbounded-concurrency.rule.yaml +33 -0
- package/rules/python/py.security.django-csrf-exempt-state-changing.rule.yaml +46 -0
- package/rules/python/py.security.django-missing-csrf-middleware.rule.yaml +47 -0
- package/rules/python/py.security.django-unsafe-production-settings.rule.yaml +47 -0
- package/rules/python/py.security.drf-allow-any-default.rule.yaml +46 -0
- package/rules/python/py.security.drf-allow-any-unsafe-method.rule.yaml +46 -0
- package/rules/python/py.security.fastapi-insecure-cors.rule.yaml +43 -0
- package/rules/python/py.security.flask-missing-upload-body-limit.rule.yaml +44 -0
- package/rules/python/py.security.flask-unsafe-html-output.rule.yaml +44 -0
- package/rules/python/py.security.flask-unsafe-upload-filename.rule.yaml +44 -0
- package/rules/python/py.testing.pytest-skip-without-ticket-reference.rule.yaml +33 -0
- package/rules/python/py.testing.real-network-in-unit-test.rule.yaml +33 -0
- package/rules/python/py.testing.time-sleep-in-unit-test.rule.yaml +33 -0
- package/rules/ruby/ruby.performance.no-regex-construction-in-loop.rule.yaml +33 -0
- package/rules/ruby/ruby.performance.no-sync-fs-in-request-path.rule.yaml +33 -0
- package/rules/ruby/ruby.performance.no-unbounded-concurrency.rule.yaml +33 -0
- package/rules/ruby/ruby.security.rails-csrf-disabled.rule.yaml +45 -0
- package/rules/ruby/ruby.security.rails-detailed-exceptions-enabled.rule.yaml +44 -0
- package/rules/ruby/ruby.security.rails-open-redirect.rule.yaml +45 -0
- package/rules/ruby/ruby.security.rails-unsafe-html-output.rule.yaml +46 -0
- package/rules/ruby/ruby.security.rails-unsafe-render.rule.yaml +45 -0
- package/rules/ruby/ruby.security.rails-unsafe-session-or-cookie-store.rule.yaml +45 -0
- package/rules/ruby/ruby.security.rails-unsafe-strong-parameters.rule.yaml +46 -0
- package/rules/ruby/ruby.security.sensitive-data-egress.rule.yaml +45 -0
- package/rules/ruby/ruby.security.sidekiq-web-unauthenticated-mount.rule.yaml +45 -0
- package/rules/ruby/ruby.testing.focused-example.rule.yaml +33 -0
- package/rules/ruby/ruby.testing.pending-without-ticket-reference.rule.yaml +33 -0
- package/rules/ruby/ruby.testing.real-network-in-unit-test.rule.yaml +33 -0
- package/rules/ruby/ruby.testing.skip-without-ticket-reference.rule.yaml +33 -0
- package/rules/ruby/ruby.testing.sleep-in-unit-test.rule.yaml +33 -0
- package/rules/rust/rust.performance.no-regex-construction-in-loop.rule.yaml +33 -0
- package/rules/rust/rust.performance.no-sync-fs-in-request-path.rule.yaml +33 -0
- package/rules/rust/rust.performance.no-unbounded-concurrency.rule.yaml +33 -0
- package/rules/rust/rust.security.actix-wildcard-cors-with-credentials.rule.yaml +47 -0
- package/rules/rust/rust.security.axum-body-limit-disabled.rule.yaml +45 -0
- package/rules/rust/rust.security.axum-insecure-cors-with-credentials.rule.yaml +47 -0
- package/rules/rust/rust.security.rocket-panic-prone-request-handler.rule.yaml +45 -0
- package/rules/rust/rust.security.rocket-unsafe-template-output.rule.yaml +47 -0
- package/rules/rust/rust.security.sqlx-diesel-raw-interpolated-query.rule.yaml +47 -0
- package/rules/rust/rust.security.template-unescaped-request-value.rule.yaml +47 -0
- package/rules/rust/rust.security.warp-blocking-or-panic-in-async-handler.rule.yaml +45 -0
- package/rules/rust/rust.testing.ignore-without-ticket-reference.rule.yaml +33 -0
- package/rules/rust/rust.testing.real-network-in-unit-test.rule.yaml +33 -0
- package/rules/rust/rust.testing.thread-sleep-in-unit-test.rule.yaml +33 -0
- package/rules/shared/security.archive-path-traversal.rule.yaml +41 -0
- package/rules/shared/security.external-file-upload.rule.yaml +40 -0
- package/rules/shared/security.permissive-file-permissions.rule.yaml +40 -0
- package/rules/shared/security.sensitive-data-egress.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.assignment-in-condition.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.assignment-to-import-binding.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.async-promise-executor.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.duplicate-function-parameter.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.duplicate-import-source.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.duplicate-object-key.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.duplicate-switch-case.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.empty-block-statement.rule.yaml +35 -0
- package/rules/typescript/ts.correctness.identical-comparison-operands.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.reassign-catch-binding.rule.yaml +35 -0
- package/rules/typescript/ts.correctness.regexp-pattern-unusual-control-character.rule.yaml +35 -0
- package/rules/typescript/ts.correctness.self-assignment.rule.yaml +36 -0
- package/rules/typescript/ts.next.server-action-missing-local-auth.rule.yaml +35 -0
- package/rules/typescript/ts.performance.no-array-spread-in-hot-loop.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-cache-miss-from-unstable-key.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-expensive-sort-in-render-path.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-json-parse-stringify-clone.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-large-object-spread-in-loop.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-n-plus-one-await-in-map.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-redundant-network-fetch.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-regex-construction-in-loop.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-sync-fs-in-request-path.rule.yaml +32 -0
- package/rules/typescript/ts.performance.no-unbounded-concurrency.rule.yaml +32 -0
- package/rules/typescript/ts.quality.no-ambiguous-abbreviations.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-barrel-file-cycle.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-boolean-parameter-trap.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-dead-export.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-hidden-side-effect-import.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-inconsistent-error-shape.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-mixed-abstraction-level.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-primitive-obsession-in-domain-model.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-temporal-coupling.rule.yaml +27 -0
- package/rules/typescript/ts.quality.no-wide-public-surface.rule.yaml +27 -0
- package/rules/typescript/ts.react.no-accessibility-label-missing.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-activedescendant-on-non-focusable-host.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-click-without-keyboard-handler.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-deprecated-create-factory.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-deprecated-react-dom-root-api.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-derived-state-from-props.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-effect-fetch-without-cancellation.rule.yaml +35 -0
- package/rules/typescript/ts.react.no-find-dom-node.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-img-missing-alt-text.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-index-as-key-in-dynamic-list.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-interactive-role-on-static-semantics.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-invalid-anchor-href.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-keyboard-interaction-without-widget-role.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-legacy-lifecycle.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-missing-error-boundary.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-positive-tabindex.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-static-element-with-synthetic-handlers.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-string-ref.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-uncontrolled-to-controlled-input.rule.yaml +34 -0
- package/rules/typescript/ts.react.no-widget-role-without-tabindex.rule.yaml +36 -0
- package/rules/typescript/ts.security.ajv-insecure-configuration.rule.yaml +34 -0
- package/rules/typescript/ts.security.angular-dom-sanitizer-bypass-untrusted-input.rule.yaml +35 -0
- package/rules/typescript/ts.security.apollo-server-csrf-disabled.rule.yaml +36 -0
- package/rules/typescript/ts.security.apollo-server-graphql-dev-tooling-exposure.rule.yaml +36 -0
- package/rules/typescript/ts.security.apollo-server-introspection-exposure.rule.yaml +35 -0
- package/rules/typescript/ts.security.apollo-server-missing-query-limits.rule.yaml +35 -0
- package/rules/typescript/ts.security.astro-vite-public-secret-define.rule.yaml +39 -0
- package/rules/typescript/ts.security.debug-statement-in-source.rule.yaml +36 -0
- package/rules/typescript/ts.security.electron-dangerous-webpreferences.rule.yaml +35 -0
- package/rules/typescript/ts.security.electron-insecure-local-state.rule.yaml +35 -0
- package/rules/typescript/ts.security.electron-missing-ipc-origin-check.rule.yaml +35 -0
- package/rules/typescript/ts.security.electron-shell-open-external-unvalidated.rule.yaml +35 -0
- package/rules/typescript/ts.security.express-error-handler-information-disclosure.rule.yaml +35 -0
- package/rules/typescript/ts.security.express-static-dotfiles-allow.rule.yaml +35 -0
- package/rules/typescript/ts.security.express-unbounded-body-parser.rule.yaml +34 -0
- package/rules/typescript/ts.security.express-user-controlled-static-mount.rule.yaml +35 -0
- package/rules/typescript/ts.security.fastify-excessive-body-limit.rule.yaml +34 -0
- package/rules/typescript/ts.security.fastify-public-bind-without-trust-proxy.rule.yaml +38 -0
- package/rules/typescript/ts.security.graphql-upload-without-csrf-guard.rule.yaml +36 -0
- package/rules/typescript/ts.security.iframe-missing-sandbox-attribute.rule.yaml +35 -0
- package/rules/typescript/ts.security.insecure-content-security-policy-literal.rule.yaml +35 -0
- package/rules/typescript/ts.security.insecure-helmet-hardening-options.rule.yaml +36 -0
- package/rules/typescript/ts.security.jwt-insecure-signing-algorithm.rule.yaml +35 -0
- package/rules/typescript/ts.security.legacy-buffer-constructor.rule.yaml +35 -0
- package/rules/typescript/ts.security.log-injection.rule.yaml +36 -0
- package/rules/typescript/ts.security.nestjs-helmet-after-route-mount.rule.yaml +34 -0
- package/rules/typescript/ts.security.nestjs-missing-global-validation-pipe.rule.yaml +35 -0
- package/rules/typescript/ts.security.nestjs-skip-throttle-sensitive-route.rule.yaml +35 -0
- package/rules/typescript/ts.security.nestjs-validation-pipe-without-whitelist.rule.yaml +36 -0
- package/rules/typescript/ts.security.nuxt-public-runtime-secret.rule.yaml +38 -0
- package/rules/typescript/ts.security.open-redirect.rule.yaml +2 -0
- package/rules/typescript/ts.security.request-driven-array-index-access.rule.yaml +33 -0
- package/rules/typescript/ts.security.sensitive-data-egress.rule.yaml +1 -0
- package/rules/typescript/ts.security.ssrf.rule.yaml +1 -0
- package/rules/typescript/ts.security.unsafe-dompurify-version.rule.yaml +36 -0
- package/rules/typescript/ts.security.unsafe-marked-version.rule.yaml +36 -0
- package/rules/typescript/ts.security.xml-parse-string-with-untrusted-input.rule.yaml +35 -0
- package/rules/typescript/ts.testing.no-flaky-timer-test.rule.yaml +38 -0
- package/rules/typescript/ts.testing.no-focused-test.rule.yaml +34 -0
- package/rules/typescript/ts.testing.no-missing-edge-case-tests.rule.yaml +35 -0
- package/rules/typescript/ts.testing.no-network-call-in-unit-test.rule.yaml +38 -0
- package/rules/typescript/ts.testing.no-skipped-test-without-ticket.rule.yaml +34 -0
- package/rules/typescript/ts.testing.no-snapshot-without-intent.rule.yaml +34 -0
- package/rules/typescript/ts.testing.no-test-only-code-in-production.rule.yaml +38 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.testing.skip-without-ticket-reference
|
|
5
|
+
title: RSpec skip should cite a ticket
|
|
6
|
+
summary: skip(...) without a nearby tracker reference is hard to triage.
|
|
7
|
+
rationale: Skips without traceability tend to linger.
|
|
8
|
+
tags:
|
|
9
|
+
- testing
|
|
10
|
+
- ruby
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- ruby
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: ruby.testing.skip-without-ticket-reference
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: quality.testing
|
|
24
|
+
severity: medium
|
|
25
|
+
confidence: 0.66
|
|
26
|
+
tags:
|
|
27
|
+
- testing
|
|
28
|
+
- ruby
|
|
29
|
+
message:
|
|
30
|
+
title: Add a ticket reference to `${captures.issue.text}`
|
|
31
|
+
summary: "`skip` is used without an adjacent issue key or accepted suppression comment."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Link the skip to a tracker id or document the temporary bypass with an owner.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.testing.sleep-in-unit-test
|
|
5
|
+
title: Avoid sleep in Ruby unit tests
|
|
6
|
+
summary: sleep in specs slows CI and hides synchronization bugs.
|
|
7
|
+
rationale: Prefer deterministic waits or travel_to style time helpers.
|
|
8
|
+
tags:
|
|
9
|
+
- testing
|
|
10
|
+
- ruby
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- ruby
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: ruby.testing.sleep-in-unit-test
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: quality.testing
|
|
24
|
+
severity: low
|
|
25
|
+
confidence: 0.58
|
|
26
|
+
tags:
|
|
27
|
+
- testing
|
|
28
|
+
- ruby
|
|
29
|
+
message:
|
|
30
|
+
title: Replace `sleep` in specs
|
|
31
|
+
summary: "`${captures.issue.text}` blocks on real wall-clock time inside a spec-like path."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Use event-driven waits, shorten delays, or move timing coverage to integration suites.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.performance.no-regex-construction-in-loop
|
|
5
|
+
title: Avoid no regex construction in loop
|
|
6
|
+
summary: Performance hygiene signal for rust sources.
|
|
7
|
+
rationale: Performance hygiene signal for rust sources.
|
|
8
|
+
tags:
|
|
9
|
+
- performance
|
|
10
|
+
- rust
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- rust
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: rust.performance.no-regex-construction-in-loop
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: performance.allocation
|
|
24
|
+
severity: medium
|
|
25
|
+
confidence: 0.66
|
|
26
|
+
tags:
|
|
27
|
+
- performance
|
|
28
|
+
- rust
|
|
29
|
+
message:
|
|
30
|
+
title: Avoid no regex construction in loop in `rust` code
|
|
31
|
+
summary: "`${captures.issue.text}` matches rust.performance.no-regex-construction-in-loop."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Refactor this path to reduce avoidable runtime overhead.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.performance.no-sync-fs-in-request-path
|
|
5
|
+
title: Avoid no sync fs in request path
|
|
6
|
+
summary: Performance hygiene signal for rust sources.
|
|
7
|
+
rationale: Performance hygiene signal for rust sources.
|
|
8
|
+
tags:
|
|
9
|
+
- performance
|
|
10
|
+
- rust
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- rust
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: rust.performance.no-sync-fs-in-request-path
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: performance.io
|
|
24
|
+
severity: high
|
|
25
|
+
confidence: 0.66
|
|
26
|
+
tags:
|
|
27
|
+
- performance
|
|
28
|
+
- rust
|
|
29
|
+
message:
|
|
30
|
+
title: Avoid no sync fs in request path in `rust` code
|
|
31
|
+
summary: "`${captures.issue.text}` matches rust.performance.no-sync-fs-in-request-path."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Refactor this path to reduce avoidable runtime overhead.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.performance.no-unbounded-concurrency
|
|
5
|
+
title: Avoid no unbounded concurrency
|
|
6
|
+
summary: Performance hygiene signal for rust sources.
|
|
7
|
+
rationale: Performance hygiene signal for rust sources.
|
|
8
|
+
tags:
|
|
9
|
+
- performance
|
|
10
|
+
- rust
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- rust
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: rust.performance.no-unbounded-concurrency
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: performance.async
|
|
24
|
+
severity: medium
|
|
25
|
+
confidence: 0.66
|
|
26
|
+
tags:
|
|
27
|
+
- performance
|
|
28
|
+
- rust
|
|
29
|
+
message:
|
|
30
|
+
title: Avoid no unbounded concurrency in `rust` code
|
|
31
|
+
summary: "`${captures.issue.text}` matches rust.performance.no-unbounded-concurrency."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Refactor this path to reduce avoidable runtime overhead.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.actix-wildcard-cors-with-credentials
|
|
5
|
+
title: Avoid Actix any-origin CORS with credentials enabled
|
|
6
|
+
summary: >-
|
|
7
|
+
`actix_cors` configurations must not combine `allow_any_origin` with `supports_credentials`.
|
|
8
|
+
rationale: >-
|
|
9
|
+
Wildcard origins with credentials violate browser CORS expectations and usually indicate a missing explicit origin allowlist.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- actix
|
|
14
|
+
- cors
|
|
15
|
+
- rules-catalog
|
|
16
|
+
stability: experimental
|
|
17
|
+
appliesTo: block
|
|
18
|
+
scope:
|
|
19
|
+
languages:
|
|
20
|
+
- rust
|
|
21
|
+
paths:
|
|
22
|
+
include:
|
|
23
|
+
- "**/*.rs"
|
|
24
|
+
exclude:
|
|
25
|
+
- "**/tests/**"
|
|
26
|
+
- "**/*_test.rs"
|
|
27
|
+
- "**/examples/**"
|
|
28
|
+
match:
|
|
29
|
+
fact:
|
|
30
|
+
kind: rust.security.actix-wildcard-cors-with-credentials
|
|
31
|
+
bind: issue
|
|
32
|
+
emit:
|
|
33
|
+
finding:
|
|
34
|
+
category: security.misconfiguration
|
|
35
|
+
severity: high
|
|
36
|
+
confidence: 0.84
|
|
37
|
+
tags:
|
|
38
|
+
- security
|
|
39
|
+
- rust
|
|
40
|
+
- actix
|
|
41
|
+
- cors
|
|
42
|
+
message:
|
|
43
|
+
title: Replace wildcard Actix CORS with explicit origins in `${captures.issue.text}`
|
|
44
|
+
summary: "`${captures.issue.text}` enables credentials on an any-origin CORS policy."
|
|
45
|
+
remediation:
|
|
46
|
+
summary: >-
|
|
47
|
+
Use `allowed_origin` with explicit HTTPS origins, or disable credentials when anonymous public access is intended.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.axum-body-limit-disabled
|
|
5
|
+
title: Do not disable Axum default body limits for untrusted uploads
|
|
6
|
+
summary: >-
|
|
7
|
+
Axum apps should keep a finite `DefaultBodyLimit` (or equivalent) so request bodies cannot exhaust memory.
|
|
8
|
+
rationale: >-
|
|
9
|
+
`DefaultBodyLimit::disable()` removes the framework guardrail against huge bodies and is unsafe on routes that accept untrusted input.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- axum
|
|
14
|
+
- rules-catalog
|
|
15
|
+
stability: experimental
|
|
16
|
+
appliesTo: block
|
|
17
|
+
scope:
|
|
18
|
+
languages:
|
|
19
|
+
- rust
|
|
20
|
+
paths:
|
|
21
|
+
include:
|
|
22
|
+
- "**/*.rs"
|
|
23
|
+
exclude:
|
|
24
|
+
- "**/tests/**"
|
|
25
|
+
- "**/*_test.rs"
|
|
26
|
+
- "**/examples/**"
|
|
27
|
+
match:
|
|
28
|
+
fact:
|
|
29
|
+
kind: rust.security.axum-body-limit-disabled
|
|
30
|
+
bind: issue
|
|
31
|
+
emit:
|
|
32
|
+
finding:
|
|
33
|
+
category: security.misconfiguration
|
|
34
|
+
severity: high
|
|
35
|
+
confidence: 0.86
|
|
36
|
+
tags:
|
|
37
|
+
- security
|
|
38
|
+
- rust
|
|
39
|
+
- axum
|
|
40
|
+
message:
|
|
41
|
+
title: Restore a body size limit instead of `${captures.issue.text}`
|
|
42
|
+
summary: "`${captures.issue.text}` disables Axum body limits; prefer `DefaultBodyLimit::max(...)` or a reverse-proxy limit."
|
|
43
|
+
remediation:
|
|
44
|
+
summary: >-
|
|
45
|
+
Set an explicit max body size with `DefaultBodyLimit::max`, add `tower_http::limit::RequestBodyLimitLayer`, or enforce limits at your edge proxy before accepting large uploads.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.axum-insecure-cors-with-credentials
|
|
5
|
+
title: Avoid permissive tower-http CORS with credentials in Axum
|
|
6
|
+
summary: >-
|
|
7
|
+
Do not pair wildcard or `very_permissive` origin policies with credentialed CORS or private-network access in `tower-http`.
|
|
8
|
+
rationale: >-
|
|
9
|
+
Browsers treat credentialed CORS as trusted cross-origin behavior; permissive origin lists undermine that contract and often hide missing explicit allowlists.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- axum
|
|
14
|
+
- cors
|
|
15
|
+
- rules-catalog
|
|
16
|
+
stability: experimental
|
|
17
|
+
appliesTo: block
|
|
18
|
+
scope:
|
|
19
|
+
languages:
|
|
20
|
+
- rust
|
|
21
|
+
paths:
|
|
22
|
+
include:
|
|
23
|
+
- "**/*.rs"
|
|
24
|
+
exclude:
|
|
25
|
+
- "**/tests/**"
|
|
26
|
+
- "**/*_test.rs"
|
|
27
|
+
- "**/examples/**"
|
|
28
|
+
match:
|
|
29
|
+
fact:
|
|
30
|
+
kind: rust.security.axum-insecure-cors-with-credentials
|
|
31
|
+
bind: issue
|
|
32
|
+
emit:
|
|
33
|
+
finding:
|
|
34
|
+
category: security.misconfiguration
|
|
35
|
+
severity: high
|
|
36
|
+
confidence: 0.8
|
|
37
|
+
tags:
|
|
38
|
+
- security
|
|
39
|
+
- rust
|
|
40
|
+
- axum
|
|
41
|
+
- cors
|
|
42
|
+
message:
|
|
43
|
+
title: Tighten CORS configuration around `${captures.issue.text}`
|
|
44
|
+
summary: "`${captures.issue.text}` combines permissive origins with credentialed or private-network CORS behavior."
|
|
45
|
+
remediation:
|
|
46
|
+
summary: >-
|
|
47
|
+
Prefer explicit HTTPS `AllowOrigin` lists, avoid `CorsLayer::very_permissive` with `allow_credentials(true)`, and only enable `allow_private_network` with strict origin controls.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.rocket-panic-prone-request-handler
|
|
5
|
+
title: Avoid panicking on request-derived data in Rocket handlers
|
|
6
|
+
summary: >-
|
|
7
|
+
Rocket route handlers should not `unwrap`, `expect`, or otherwise panic on values derived from the HTTP request.
|
|
8
|
+
rationale: >-
|
|
9
|
+
Panics become hard failures and can be abused for denial-of-service or to leak error detail; prefer `Result` and typed rejections.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- rocket
|
|
14
|
+
- rules-catalog
|
|
15
|
+
stability: experimental
|
|
16
|
+
appliesTo: block
|
|
17
|
+
scope:
|
|
18
|
+
languages:
|
|
19
|
+
- rust
|
|
20
|
+
paths:
|
|
21
|
+
include:
|
|
22
|
+
- "**/*.rs"
|
|
23
|
+
exclude:
|
|
24
|
+
- "**/tests/**"
|
|
25
|
+
- "**/*_test.rs"
|
|
26
|
+
- "**/examples/**"
|
|
27
|
+
match:
|
|
28
|
+
fact:
|
|
29
|
+
kind: rust.security.rocket-panic-prone-request-handler
|
|
30
|
+
bind: issue
|
|
31
|
+
emit:
|
|
32
|
+
finding:
|
|
33
|
+
category: security.error-handling
|
|
34
|
+
severity: medium
|
|
35
|
+
confidence: 0.74
|
|
36
|
+
tags:
|
|
37
|
+
- security
|
|
38
|
+
- rust
|
|
39
|
+
- rocket
|
|
40
|
+
message:
|
|
41
|
+
title: Replace infallible unwraps in Rocket handler near `${captures.issue.text}`
|
|
42
|
+
summary: "`${captures.issue.text}` can panic on malformed or hostile input in a Rocket request handler."
|
|
43
|
+
remediation:
|
|
44
|
+
summary: >-
|
|
45
|
+
Return `Result`, `Option`, or `status::Custom`, map errors to HTTP responses, and reserve `unwrap` for tests or statically known invariants.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.rocket-unsafe-template-output
|
|
5
|
+
title: Avoid raw HTML built from Rocket route parameters
|
|
6
|
+
summary: >-
|
|
7
|
+
Do not wrap request-sourced strings in `RawHtml` (or similar) without escaping in Rocket handlers.
|
|
8
|
+
rationale: >-
|
|
9
|
+
Raw HTML bypasses Rocket's escaping defaults and is a common XSS footgun when fed from path, query, or body inputs.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- rocket
|
|
14
|
+
- xss
|
|
15
|
+
- rules-catalog
|
|
16
|
+
stability: experimental
|
|
17
|
+
appliesTo: block
|
|
18
|
+
scope:
|
|
19
|
+
languages:
|
|
20
|
+
- rust
|
|
21
|
+
paths:
|
|
22
|
+
include:
|
|
23
|
+
- "**/*.rs"
|
|
24
|
+
exclude:
|
|
25
|
+
- "**/tests/**"
|
|
26
|
+
- "**/*_test.rs"
|
|
27
|
+
- "**/examples/**"
|
|
28
|
+
match:
|
|
29
|
+
fact:
|
|
30
|
+
kind: rust.security.rocket-unsafe-template-output
|
|
31
|
+
bind: issue
|
|
32
|
+
emit:
|
|
33
|
+
finding:
|
|
34
|
+
category: security.output-encoding
|
|
35
|
+
severity: high
|
|
36
|
+
confidence: 0.76
|
|
37
|
+
tags:
|
|
38
|
+
- security
|
|
39
|
+
- rust
|
|
40
|
+
- rocket
|
|
41
|
+
- xss
|
|
42
|
+
message:
|
|
43
|
+
title: Escape or sanitize before `${captures.issue.text}`
|
|
44
|
+
summary: "`${captures.issue.text}` emits raw HTML from handler parameters without an obvious sanitizer."
|
|
45
|
+
remediation:
|
|
46
|
+
summary: >-
|
|
47
|
+
Prefer typed templates with auto-escaping, sanitize with a vetted HTML policy crate, or return plain text/JSON instead of `RawHtml`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.sqlx-diesel-raw-interpolated-query
|
|
5
|
+
title: Avoid dynamic SQL built with format! for SQLx or Diesel
|
|
6
|
+
summary: >-
|
|
7
|
+
Do not pass `format!(...)` (or equivalent string concatenation) into `sqlx::query` or `diesel::sql_query` sinks.
|
|
8
|
+
rationale: >-
|
|
9
|
+
Interpolated SQL is the primary SQL injection pattern in Rust ORMs; compile-time macros and bind parameters keep queries safe.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- sqlx
|
|
14
|
+
- diesel
|
|
15
|
+
- rules-catalog
|
|
16
|
+
stability: experimental
|
|
17
|
+
appliesTo: block
|
|
18
|
+
scope:
|
|
19
|
+
languages:
|
|
20
|
+
- rust
|
|
21
|
+
paths:
|
|
22
|
+
include:
|
|
23
|
+
- "**/*.rs"
|
|
24
|
+
exclude:
|
|
25
|
+
- "**/tests/**"
|
|
26
|
+
- "**/*_test.rs"
|
|
27
|
+
- "**/examples/**"
|
|
28
|
+
match:
|
|
29
|
+
fact:
|
|
30
|
+
kind: rust.security.sqlx-diesel-raw-interpolated-query
|
|
31
|
+
bind: issue
|
|
32
|
+
emit:
|
|
33
|
+
finding:
|
|
34
|
+
category: security.sql-injection
|
|
35
|
+
severity: high
|
|
36
|
+
confidence: 0.88
|
|
37
|
+
tags:
|
|
38
|
+
- security
|
|
39
|
+
- rust
|
|
40
|
+
- sqlx
|
|
41
|
+
- diesel
|
|
42
|
+
message:
|
|
43
|
+
title: Replace interpolated SQL at `${captures.issue.text}`
|
|
44
|
+
summary: "`${captures.issue.text}` builds SQL with `format!` instead of bound parameters or compile-time checked macros."
|
|
45
|
+
remediation:
|
|
46
|
+
summary: >-
|
|
47
|
+
Prefer `sqlx::query!` / `query_as!`, use `.bind(...)` on typed query builders, or Diesel's query DSL with bound parameters instead of raw interpolated strings.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.template-unescaped-request-value
|
|
5
|
+
title: Sanitize request data before unescaped template output in Rust
|
|
6
|
+
summary: >-
|
|
7
|
+
Tera, Maud, and similar engines should not insert request-sourced strings into contexts or `PreEscaped`/`raw` sinks without sanitization.
|
|
8
|
+
rationale: >-
|
|
9
|
+
Template `safe`/raw sinks disable escaping; feeding path, query, form, or JSON extractors there is a direct XSS vector.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- templates
|
|
14
|
+
- xss
|
|
15
|
+
- rules-catalog
|
|
16
|
+
stability: experimental
|
|
17
|
+
appliesTo: block
|
|
18
|
+
scope:
|
|
19
|
+
languages:
|
|
20
|
+
- rust
|
|
21
|
+
paths:
|
|
22
|
+
include:
|
|
23
|
+
- "**/*.rs"
|
|
24
|
+
exclude:
|
|
25
|
+
- "**/tests/**"
|
|
26
|
+
- "**/*_test.rs"
|
|
27
|
+
- "**/examples/**"
|
|
28
|
+
match:
|
|
29
|
+
fact:
|
|
30
|
+
kind: rust.security.template-unescaped-request-value
|
|
31
|
+
bind: issue
|
|
32
|
+
emit:
|
|
33
|
+
finding:
|
|
34
|
+
category: security.output-encoding
|
|
35
|
+
severity: high
|
|
36
|
+
confidence: 0.74
|
|
37
|
+
tags:
|
|
38
|
+
- security
|
|
39
|
+
- rust
|
|
40
|
+
- templates
|
|
41
|
+
- xss
|
|
42
|
+
message:
|
|
43
|
+
title: Escape or sanitize before `${captures.issue.text}`
|
|
44
|
+
summary: "`${captures.issue.text}` feeds request-derived data into an unescaped template context."
|
|
45
|
+
remediation:
|
|
46
|
+
summary: >-
|
|
47
|
+
HTML-escape with a vetted policy (for example `ammonia::clean`), keep auto-escaping on, and avoid `PreEscaped`/`Markup::raw` for untrusted strings.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.security.warp-blocking-or-panic-in-async-handler
|
|
5
|
+
title: Avoid blocking I/O and infallible unwraps in async Warp handlers
|
|
6
|
+
summary: >-
|
|
7
|
+
Warp filters and handlers run on the async runtime; avoid `std::fs`, `thread::sleep`, and `unwrap` on request paths without `spawn_blocking` or proper errors.
|
|
8
|
+
rationale: >-
|
|
9
|
+
Blocking the runtime reduces availability and unwraps turn parse errors into panics; both are amplified under load and hostile traffic.
|
|
10
|
+
tags:
|
|
11
|
+
- security
|
|
12
|
+
- rust
|
|
13
|
+
- warp
|
|
14
|
+
- rules-catalog
|
|
15
|
+
stability: experimental
|
|
16
|
+
appliesTo: block
|
|
17
|
+
scope:
|
|
18
|
+
languages:
|
|
19
|
+
- rust
|
|
20
|
+
paths:
|
|
21
|
+
include:
|
|
22
|
+
- "**/*.rs"
|
|
23
|
+
exclude:
|
|
24
|
+
- "**/tests/**"
|
|
25
|
+
- "**/*_test.rs"
|
|
26
|
+
- "**/examples/**"
|
|
27
|
+
match:
|
|
28
|
+
fact:
|
|
29
|
+
kind: rust.security.warp-blocking-or-panic-in-async-handler
|
|
30
|
+
bind: issue
|
|
31
|
+
emit:
|
|
32
|
+
finding:
|
|
33
|
+
category: security.availability
|
|
34
|
+
severity: medium
|
|
35
|
+
confidence: 0.72
|
|
36
|
+
tags:
|
|
37
|
+
- security
|
|
38
|
+
- rust
|
|
39
|
+
- warp
|
|
40
|
+
message:
|
|
41
|
+
title: Refactor async Warp handler around `${captures.issue.text}`
|
|
42
|
+
summary: "`${captures.issue.text}` blocks the async executor or can panic inside a Warp async handler."
|
|
43
|
+
remediation:
|
|
44
|
+
summary: >-
|
|
45
|
+
Use `tokio::fs`, offload blocking work with `spawn_blocking`, and propagate errors with `Rejection` instead of `unwrap`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.testing.ignore-without-ticket-reference
|
|
5
|
+
title: "Rust #[ignore] tests should cite a ticket"
|
|
6
|
+
summary: Ignored tests without a nearby tracker comment are easy to lose.
|
|
7
|
+
rationale: Ignored tests should carry reviewable intent like skips in other ecosystems.
|
|
8
|
+
tags:
|
|
9
|
+
- testing
|
|
10
|
+
- rust
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- rust
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: rust.testing.ignore-without-ticket-reference
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: quality.testing
|
|
24
|
+
severity: medium
|
|
25
|
+
confidence: 0.62
|
|
26
|
+
tags:
|
|
27
|
+
- testing
|
|
28
|
+
- rust
|
|
29
|
+
message:
|
|
30
|
+
title: Add a ticket comment near `${captures.issue.text}`
|
|
31
|
+
summary: "`#[ignore]` is present without a nearby issue key or accepted suppression comment."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Document the ignore with a tracker id or remove the attribute when the test is ready.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.testing.real-network-in-unit-test
|
|
5
|
+
title: Avoid live reqwest clients in Rust unit tests
|
|
6
|
+
summary: reqwest usage in tests should target local servers or fakes.
|
|
7
|
+
rationale: Live HTTP couples CI to the network.
|
|
8
|
+
tags:
|
|
9
|
+
- testing
|
|
10
|
+
- rust
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- rust
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: rust.testing.real-network-in-unit-test
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: quality.testing
|
|
24
|
+
severity: medium
|
|
25
|
+
confidence: 0.64
|
|
26
|
+
tags:
|
|
27
|
+
- testing
|
|
28
|
+
- rust
|
|
29
|
+
message:
|
|
30
|
+
title: Stub outbound HTTP in `${captures.issue.text}`
|
|
31
|
+
summary: "`${captures.issue.text}` references `reqwest` inside a test-like path."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Use wiremock, axum test servers, or injected clients with deterministic responses.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: rust.testing.thread-sleep-in-unit-test
|
|
5
|
+
title: Avoid thread::sleep in Rust unit tests
|
|
6
|
+
summary: Sleeping in tests slows CI and hides synchronization bugs.
|
|
7
|
+
rationale: Prefer deterministic synchronization or tokio time advances.
|
|
8
|
+
tags:
|
|
9
|
+
- testing
|
|
10
|
+
- rust
|
|
11
|
+
- rules-catalog
|
|
12
|
+
stability: experimental
|
|
13
|
+
appliesTo: block
|
|
14
|
+
scope:
|
|
15
|
+
languages:
|
|
16
|
+
- rust
|
|
17
|
+
match:
|
|
18
|
+
fact:
|
|
19
|
+
kind: rust.testing.thread-sleep-in-unit-test
|
|
20
|
+
bind: issue
|
|
21
|
+
emit:
|
|
22
|
+
finding:
|
|
23
|
+
category: quality.testing
|
|
24
|
+
severity: low
|
|
25
|
+
confidence: 0.6
|
|
26
|
+
tags:
|
|
27
|
+
- testing
|
|
28
|
+
- rust
|
|
29
|
+
message:
|
|
30
|
+
title: Replace sleep in `${captures.issue.text}`
|
|
31
|
+
summary: "`${captures.issue.text}` blocks on real wall-clock time inside a test-like path."
|
|
32
|
+
remediation:
|
|
33
|
+
summary: Use `tokio::time::pause`, condvars, or scoped integration tests for real delays.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: security.archive-path-traversal
|
|
5
|
+
title: Sanitize archive entry paths before writing
|
|
6
|
+
summary: Archive extraction should not write entry names directly to the filesystem.
|
|
7
|
+
rationale: Archive entries can contain traversal paths that overwrite files outside the intended extraction directory.
|
|
8
|
+
tags:
|
|
9
|
+
- security
|
|
10
|
+
- filesystem
|
|
11
|
+
- archive
|
|
12
|
+
- path-traversal
|
|
13
|
+
- rules-catalog
|
|
14
|
+
stability: experimental
|
|
15
|
+
appliesTo: block
|
|
16
|
+
scope:
|
|
17
|
+
languages:
|
|
18
|
+
- go
|
|
19
|
+
- java
|
|
20
|
+
- php
|
|
21
|
+
- python
|
|
22
|
+
- ruby
|
|
23
|
+
- rust
|
|
24
|
+
match:
|
|
25
|
+
fact:
|
|
26
|
+
kind: security.archive-path-traversal
|
|
27
|
+
bind: issue
|
|
28
|
+
emit:
|
|
29
|
+
finding:
|
|
30
|
+
category: security.filesystem
|
|
31
|
+
severity: high
|
|
32
|
+
confidence: 0.82
|
|
33
|
+
tags:
|
|
34
|
+
- security
|
|
35
|
+
- filesystem
|
|
36
|
+
- archive
|
|
37
|
+
message:
|
|
38
|
+
title: Check archive containment for `${captures.issue.text}`
|
|
39
|
+
summary: "`${captures.issue.text}` may write an archive-controlled path without a containment check."
|
|
40
|
+
remediation:
|
|
41
|
+
summary: Normalize each entry path against a trusted extraction root and reject paths that escape it.
|