Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps(cargo): Use precise dependency version specifiers #1688

Merged
merged 4 commits into from
Feb 10, 2022

Conversation

lopopolo
Copy link
Member

See: https://users.rust-lang.org/t/psa-please-specify-precise-dependency-versions-in-cargo-toml/71277

Artichoke haphazardly set precise minimal version bounds but did so inconsistently and used strange 0.x, >= 0.x.y specifiers to work around @dependabot specific behavior. Moving to rollup PRs like #1677 removes the need for this strangeness.

When the same dependency is used in multiple workspace crates, this PR changes them all to use the same lower bound. When. compiling a workspace with -Z minimal-version, only the highest effective lower bound is tested, so modify the constraints to reflect that.

While touching a bunch of Cargo.toml manifests, I noticed some crates which were missing package.metadata.docs.rs sections, which have been added.

This PR also runs a cargo update, which should close out:

```console
$ cargo update
    Updating crates.io index
    Updating autocfg v1.0.1 -> v1.1.0
    Updating libc v0.2.116 -> v0.2.117
    Updating unicode-segmentation v1.8.0 -> v1.9.0
$ cd fuzz
$ cargo update
    Updating crates.io index
    Updating arbitrary v1.0.3 -> v1.1.0
    Updating autocfg v1.0.1 -> v1.1.0
    Updating libc v0.2.116 -> v0.2.117
$ cd ../spec-runner/
$ cargo update
    Updating crates.io index
    Updating autocfg v1.0.1 -> v1.1.0
    Updating libc v0.2.116 -> v0.2.117
$ cd ../ui-tests/
$ cargo update
    Updating crates.io index
    Updating autocfg v1.0.1 -> v1.1.0
    Updating libc v0.2.116 -> v0.2.117
```
@lopopolo lopopolo added A-deps Area: Source and library dependencies. C-quality Category: Refactoring, cleanup, and quality improvements. labels Feb 10, 2022
@lopopolo lopopolo merged commit 99cf04b into trunk Feb 10, 2022
@lopopolo lopopolo deleted the lopopolo/fully-specified-dep-semver-versions branch February 10, 2022 07:21
@lopopolo lopopolo added the A-packaging Area: Packaging releases for distribution. label Feb 10, 2022
lopopolo added a commit that referenced this pull request Mar 8, 2022
The Rust `regex` crate is vulnerable to a denial of service
vulnerability similar to the billion laughs XML parsing vulnerability
when compiling empty patterns with repeat expressions.

Artichoke uses `regex` to parse untrusted Regexp patterns.

Artichoke is not believed to be vulnerable in its default configuration.
In its default feature configuration, Artichoke parses Regexp patterns
with `oniguruma` before delegating to `regex`. Oniguruma has mitigations
for large numbers of pattern repetitions.

For at least the test cases added to `regex`, Artichoke does not have
runtime blowup:

```
artichoke 0.1.0-pre.0 (2022-03-08 revision 5350) [x86_64-apple-darwin]
[rustc 1.58.1 (db9d1b20b 2022-01-20) on x86_64-apple-darwin]
>>> /(?:){294967295}/
Traceback (most recent call last):
        1: from (airb):1
RegexpError (too big number for repeat range)
>>> /(?:){64}{64}{64}{64}{64}{64}/
Traceback (most recent call last):
        1: from (airb):2
RegexpError (too big number for repeat range)
>>> /x{0}{4294967295}/
Traceback (most recent call last):
        1: from (airb):3
RegexpError (too big number for repeat range)
>>> /(?:|){4294967295}/
Traceback (most recent call last):
        1: from (airb):4
RegexpError (too big number for repeat range)
```

This commit also removes an overly loose `regex = "1"` version
specifier in `artichoke-backend` which was overlooked in #1688.

See:

- GHSA-m5pq-gvj9-9vr8
- CVE-2022-24713
- rust-lang/regex@ae70b41
- https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw/m/jiZv_PAABQAJ
lopopolo added a commit that referenced this pull request Mar 8, 2022
The Rust `regex` crate is vulnerable to a denial of service
vulnerability similar to the billion laughs XML parsing vulnerability
when compiling empty patterns with repeat expressions.

Artichoke uses `regex` to parse untrusted Regexp patterns.

Artichoke is not believed to be vulnerable in its default configuration.
In its default feature configuration, Artichoke parses Regexp patterns
with `oniguruma` before delegating to `regex`. Oniguruma has mitigations
for large numbers of pattern repetitions.

For at least the test cases added to `regex`, Artichoke does not have
runtime blowup:

```
artichoke 0.1.0-pre.0 (2022-03-08 revision 5350) [x86_64-apple-darwin]
[rustc 1.58.1 (db9d1b20b 2022-01-20) on x86_64-apple-darwin]
>>> /(?:){294967295}/
Traceback (most recent call last):
        1: from (airb):1
RegexpError (too big number for repeat range)
>>> /(?:){64}{64}{64}{64}{64}{64}/
Traceback (most recent call last):
        1: from (airb):2
RegexpError (too big number for repeat range)
>>> /x{0}{4294967295}/
Traceback (most recent call last):
        1: from (airb):3
RegexpError (too big number for repeat range)
>>> /(?:|){4294967295}/
Traceback (most recent call last):
        1: from (airb):4
RegexpError (too big number for repeat range)
```

This commit also removes an overly loose `regex = "1"` version
specifier in `artichoke-backend` which was overlooked in #1688.

See:

- GHSA-m5pq-gvj9-9vr8
- CVE-2022-24713
- rust-lang/regex@ae70b41
- https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw/m/jiZv_PAABQAJ
lopopolo added a commit to artichoke/ruby-file-expand-path that referenced this pull request Mar 11, 2022
See artichoke/artichoke#1688 and similar PRs in the Artichoke GitHub org for dep-side changes.
lopopolo added a commit to artichoke/raw-parts that referenced this pull request Mar 11, 2022
See artichoke/artichoke#1688 and similar PRs in the Artichoke GitHub org for dep-side changes.
lopopolo added a commit to artichoke/rand_mt that referenced this pull request Mar 11, 2022
See artichoke/artichoke#1688 and similar PRs in the Artichoke GitHub org for dep-side changes.
lopopolo added a commit to artichoke/intaglio that referenced this pull request Mar 11, 2022
See artichoke/artichoke#1688 and similar PRs in the Artichoke GitHub org for dep-side changes.
lopopolo added a commit to artichoke/focaccia that referenced this pull request Mar 11, 2022
See artichoke/artichoke#1688 and similar PRs in the Artichoke GitHub org for dep-side changes.
lopopolo added a commit to artichoke/cactusref that referenced this pull request Mar 11, 2022
See artichoke/artichoke#1688 and similar PRs in the Artichoke GitHub org for dep-side changes.
lopopolo added a commit to artichoke/boba that referenced this pull request Mar 11, 2022
See artichoke/artichoke#1688 and similar PRs in the Artichoke GitHub org for dep-side changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-deps Area: Source and library dependencies. A-packaging Area: Packaging releases for distribution. C-quality Category: Refactoring, cleanup, and quality improvements.
Development

Successfully merging this pull request may close these issues.

None yet

1 participant