This project contains known security vulnerabilities. Find detailed information at the bottom.

Crate pbtc

Dependencies

(4 total, 2 outdated)

CrateRequiredLatestStatus
 log^0.40.4.22up to date
 env_logger^0.50.11.5out of date
 libc^0.20.2.158up to date
 clap^24.5.17out of date

Crate chain

Dependencies

(3 total, all up-to-date)

CrateRequiredLatestStatus
 rustc-hex^22.1.0up to date
 heapsize^0.40.4.2up to date
 rayon^1.01.10.0up to date

Crate keys

Dependencies

(4 total, 2 outdated)

CrateRequiredLatestStatus
 rand^0.40.8.5out of date
 rustc-hex^22.1.0up to date
 lazy_static^1.4.01.5.0up to date
 base58^0.10.2.0out of date

Crate message

Dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 byteorder^1.01.5.0up to date

Crate network

Dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 lazy_static^1.4.01.5.0up to date

Crate miner

Dependencies

(2 total, all up-to-date)

CrateRequiredLatestStatus
 byteorder^1.01.5.0up to date
 heapsize^0.40.4.2up to date

Crate p2p

Dependencies

(11 total, 6 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 tokio-core^0.1.60.1.18up to date
 tokio-io^0.1.10.1.13up to date
 parking_lot^0.40.12.3out of date
 futures^0.10.3.30out of date
 futures-cpupool^0.10.1.8up to date
 time ⚠️^0.10.3.36out of date
 rand^0.40.8.5out of date
 log^0.40.4.22up to date
 abstract-ns^0.30.4.3out of date
 ns-dns-tokio^0.30.4.0out of date
 csv^11.3.0up to date

Crate script

Dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 log^0.40.4.22up to date

Crate storage

Dependencies

(5 total, 3 outdated)

CrateRequiredLatestStatus
 elastic-array^0.60.11.0out of date
 parking_lot^0.40.12.3out of date
 bit-vec^0.40.8.0out of date
 lru-cache^0.10.1.2up to date
 display_derive^0.0.00.0.0up to date

Crate db

Dependencies

(5 total, 3 outdated)

CrateRequiredLatestStatus
 elastic-array^0.60.11.0out of date
 parking_lot^0.40.12.3out of date
 log^0.40.4.22up to date
 bit-vec^0.40.8.0out of date
 lru-cache^0.10.1.2up to date

Dev dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 tempdir^0.30.3.7up to date

Crate verification

Dependencies

(5 total, 2 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 time ⚠️^0.10.3.36out of date
 lazy_static^1.01.5.0up to date
 log^0.40.4.22up to date
 rayon^1.01.10.0up to date
 parking_lot^0.40.12.3out of date

Dev dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 assert_matches^1.3.01.5.0up to date

Crate sync

Dependencies

(9 total, 7 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 parking_lot^0.40.12.3out of date
 log^0.40.4.22up to date
 time ⚠️^0.10.3.36out of date
 futures^0.10.3.30out of date
 linked-hash-map^0.30.5.6out of date
 bit-vec^0.4.30.8.0out of date
 murmur3^0.40.5.2out of date
 rand^0.40.8.5out of date
 byteorder^1.01.5.0up to date

Crate import

Dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 log^0.40.4.22up to date

Crate logs

Dependencies

(4 total, 3 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 ansi_term^0.90.12.1out of date
 log^0.40.4.22up to date
 env_logger^0.50.11.5out of date
 time ⚠️^0.10.3.36out of date

Crate rpc

Dependencies

(6 total, all up-to-date)

CrateRequiredLatestStatus
 log^0.40.4.22up to date
 serde^1.01.0.210up to date
 serde_json^1.01.0.128up to date
 serde_derive^1.01.0.210up to date
 rustc-hex^22.1.0up to date
 tokio-core^0.1.10.1.18up to date

Crate primitives

Dependencies

(4 total, 1 outdated)

CrateRequiredLatestStatus
 heapsize^0.40.4.2up to date
 rustc-hex^22.1.0up to date
 byteorder^1.01.5.0up to date
 bigint^1.04.4.3out of date

Crate bencher

Dependencies

(2 total, 1 possibly insecure)

CrateRequiredLatestStatus
 time ⚠️*0.3.36maybe insecure
 byteorder^1.01.5.0up to date

Crate bitcrypto

Dependencies

(2 total, 1 outdated, 1 insecure)

CrateRequiredLatestStatus
 rust-crypto ⚠️^0.2.360.2.36insecure
 siphasher^0.1.11.0.1out of date

Crate serialization

Dependencies

(1 total, all up-to-date)

CrateRequiredLatestStatus
 byteorder^1.01.5.0up to date

Crate serialization_derive

Dependencies

(2 total, 2 outdated)

CrateRequiredLatestStatus
 syn^0.11.112.0.77out of date
 quote^0.3.151.0.37out of date

Crate test-data

Dependencies

(1 total, 1 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 time ⚠️^0.10.3.36out of date

Security Vulnerabilities

time: Potential segfault in the time crate

RUSTSEC-2020-0071

Impact

The affected functions set environment variables without synchronization. On Unix-like operating systems, this can crash in multithreaded programs. Programs may segfault due to dereferencing a dangling pointer if an environment variable is read in a different thread than the affected functions. This may occur without the user's knowledge, notably in the Rust standard library or third-party libraries.

The affected functions from time 0.2.7 through 0.2.22 are:

  • time::UtcOffset::local_offset_at
  • time::UtcOffset::try_local_offset_at
  • time::UtcOffset::current_local_offset
  • time::UtcOffset::try_current_local_offset
  • time::OffsetDateTime::now_local
  • time::OffsetDateTime::try_now_local

The affected functions in time 0.1 (all versions) are:

  • time::at_utc
  • time::at
  • time::now
  • time::tzset

Non-Unix targets (including Windows and wasm) are unaffected.

Patches

Pending a proper fix, the internal method that determines the local offset has been modified to always return None on the affected operating systems. This has the effect of returning an Err on the try_* methods and UTC on the non-try_* methods.

Users and library authors with time in their dependency tree should perform cargo update, which will pull in the updated, unaffected code.

Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.

Workarounds

A possible workaround for crates affected through the transitive dependency in chrono, is to avoid using the default oldtime feature dependency of the chrono crate by disabling its default-features and manually specifying the required features instead.

Examples:

Cargo.toml:

chrono = { version = "0.4", default-features = false, features = ["serde"] }
chrono = { version = "0.4.22", default-features = false, features = ["clock"] }

Commandline:

cargo add chrono --no-default-features -F clock

Sources:

rust-crypto: Miscomputation when performing AES encryption in rust-crypto

RUSTSEC-2022-0011

The following Rust program demonstrates some strangeness in AES encryption - if you have an immutable key slice and then operate on that slice, you get different encryption output than if you operate on a copy of that key.

For these functions, we expect that extending a 16 byte key to a 32 byte key by repeating it gives the same encrypted data, because the underlying rust-crypto functions repeat key data up to the necessary key size for the cipher.

use crypto::{
    aes, blockmodes, buffer,
    buffer::{BufferResult, ReadBuffer, WriteBuffer},
    symmetriccipher,
};

fn encrypt(
    key: &[u8],
    iv: &[u8],
    data: &str,
) -> Result<String, symmetriccipher::SymmetricCipherError> {
    let mut encryptor =
        aes::cbc_encryptor(aes::KeySize::KeySize256, key, iv, blockmodes::PkcsPadding);

    let mut encrypted_data = Vec::<u8>::new();
    let mut read_buffer = buffer::RefReadBuffer::new(data.as_bytes());
    let mut buffer = [0; 4096];
    let mut write_buffer = buffer::RefWriteBuffer::new(&mut buffer);

    loop {
        let result = encryptor.encrypt(&mut read_buffer, &mut write_buffer, true)?;

        encrypted_data.extend(
            write_buffer
                .take_read_buffer()
                .take_remaining()
                .iter()
                .copied(),
        );

        match result {
            BufferResult::BufferUnderflow => break,
            BufferResult::BufferOverflow => {}
        }
    }

    Ok(hex::encode(encrypted_data))
}

fn working() {
    let data = "data";
    let iv = [
        0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE,
        0xFF,
    ];
    let key = [
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
        0x0F,
    ];
    // The copy here makes the code work.
    let key_copy = key;
    let key2: Vec<u8> = key_copy.iter().cycle().take(32).copied().collect();
    println!("key1:{} key2: {}", hex::encode(&key), hex::encode(&key2));

    let x1 = encrypt(&key, &iv, data).unwrap();
    println!("X1: {}", x1);

    let x2 = encrypt(&key2, &iv, data).unwrap();
    println!("X2: {}", x2);

    assert_eq!(x1, x2);
}

fn broken() {
    let data = "data";
    let iv = [
        0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE,
        0xFF,
    ];
    let key = [
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
        0x0F,
    ];
    // This operation shouldn't affect the contents of key at all.
    let key2: Vec<u8> = key.iter().cycle().take(32).copied().collect();
    println!("key1:{} key2: {}", hex::encode(&key), hex::encode(&key2));

    let x1 = encrypt(&key, &iv, data).unwrap();
    println!("X1: {}", x1);

    let x2 = encrypt(&key2, &iv, data).unwrap();
    println!("X2: {}", x2);

    assert_eq!(x1, x2);
}

fn main() {
    working();
    broken();
}

The output from this program:

     Running `target/host/debug/rust-crypto-test`
key1:000102030405060708090a0b0c0d0e0f key2: 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f
X1: 90462bbe32965c8e7ea0addbbed4cddb
X2: 90462bbe32965c8e7ea0addbbed4cddb
key1:000102030405060708090a0b0c0d0e0f key2: 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f
X1: 26e847e5e7df1947bf82a650548a7d5b
X2: 90462bbe32965c8e7ea0addbbed4cddb
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `"26e847e5e7df1947bf82a650548a7d5b"`,
 right: `"90462bbe32965c8e7ea0addbbed4cddb"`', src/main.rs:83:5

Notably, the X1 key in the broken() test changes every time after rerunning the program.