657 Commits (master)
 

Author SHA1 Message Date
Nicolas Favre-Felix 4b66bcf85b
Support Msgpack-C, add RedHat to test matrix
* Add support for libmsgpack-c (installed from source)
* Add Red Hat UBI 8.8 and UBI 9.2 to the build matrix
* Shorten GHA job names
11 months ago
Nicolas Favre-Felix b31fabe991
Restore previous workflow triggers for build.yml GHA 11 months ago
Nicolas Favre-Felix cce05b666f
Clean up curl-tests, install `uuid` on Ubuntu test runners 11 months ago
Nicolas Favre-Felix 90773ca519
Update GHA build.yml to use matrices of runners
* Add an Ubuntu matrix with 18.04, 20.04, 22.04, 23.04
* Make some steps conditional based on the environment
* Add a macOS matrix with macOS-11 and macOS-12
* Use Homebrew and a local Redis service started by `brew` on the macOS
  runners
11 months ago
Jessie Murray ea01d687b5
Apply ACL rules to WebSocket commands
ACLs were not considered when processing commands coming over WebSocket
connections. WS commands that are disabled with ACLs are now rejected
with a custom message for JSON and raw WS clients, the two supported
formats for this protocol. For JSON an equivalent HTTP status code is
included in the response, although this is only an indication of how
Webdis would have responded if it came from a regular HTTP request.

Tests are added to validate that DEBUG commands are rejected by Webdis
without even making it to Redis, for both JSON and raw WS clients.

Add DEBUG OBJECT demo to websocket.html: DEBUG is disabled with ACLs
by default in webdis.json. A DEBUG button is added to the WebSocket
HTML demo to show what kind of response is produced when WebSocket
clients attempt to send such a command.

The error responses are documented in the README in the ACL section.

Fixes #240.
12 months ago
Nicolas Favre-Felix bb6a3c02c9
Upgrade upload-artifact to v3 in build GHA
* Use actions/upload-artifact@v3 instead of v2
* Install nodejs in non-interactive mode to support running this job
  locally with "act"
1 year ago
Nicolas Favre-Felix 7988ec1c23
Update GHA checkout actions to v3
v2 uses node v12, a deprecated version
1 year ago
Nicolas Favre-Felix 6e08e94763
Update CodeQL GitHub Action
* Use v2 versions of the CodeQL actions
* Update runner to Ubuntu 20.04, specify container with the same OS
* Update flags to apt-get install, was using a deprecated option
1 year ago
Nicolas Favre-Felix 6057a162f7
Minor cleanup of bench.sh
* Check for `ab` and `curl` dependencies at the start
* Replace backticks with $() in bench()
* Print number of requests with thousands sep in info()
1 year ago
Nicolas Favre-Felix 9a29a85a94
GHA: upgrade Ubuntu, include Websocket tests
* Switch from Ubuntu 18.04 to 20.04
* Install WS dependency with pip
* Run WS tests as part of the "build" GHA
1 year ago
Nicolas Favre-Felix b59d866e06
Also convert tabs to spaces in README.md 1 year ago
Nicolas Favre-Felix 997932f1eb
Reformat JSON config files, use spaces instead of tabs
This should have been done long ago.
1 year ago
Nicolas Favre-Felix 546d730985
Update docker-compose+SSL docs
* Use webdis:latest
* Switch from Redis 6 to 7
* Remove outdated redis.conf line numbers
* Document required protected-mode config setting
* Remove dependency on jq in uptime validation command
1 year ago
Nicolas Favre-Felix 3ea9c46444
Update image versions in README after release
0.1.21 -> 0.1.22
1 year ago
Nicolas Favre-Felix 49d1a39e1e
Version bump after release 1 year ago
Nicolas Favre-Felix e82a64beef
Release 0.1.22 (includes security update)
New feature: added support for TCP keep-alive on connections to Redis.

Bugfix: TRACE logs were not correctly identified as such in the logs,
        they should now appear with a T prefix.

Security: this is also a security update, fixing vulnerabilities found
in the OpenSSL library, installed from Alpine Linux packages (Alpine
Linus provides the base image for Webdis).

Impact: Webdis can connect to external Webdis instances over TLS.
By default, it does not use TLS to connect to Redis, but interfaces
with Redis over a local connection within the Docker container.
Please review whether these OpenSSL vulnerabilities affect your
deployment. If you do not use TLS to connect to Redis, then you should
not be affected.

openssl 3.0.8-r1 - 1 HIGH, 6 MEDIUM
pkg:apk/alpine/openssl@3.0.8-r1?os_name=alpine&os_version=3.17

    * HIGH CVE-2023-2650
      https://scout.docker.com/v/CVE-2023-2650
      Affected range : <3.0.9-r0
      Fixed version  : 3.0.9-r0

    * MEDIUM CVE-2023-1255
      https://scout.docker.com/v/CVE-2023-1255
      Affected range : <3.0.8-r4
      Fixed version  : 3.0.8-r4

    * MEDIUM CVE-2023-3817
      https://scout.docker.com/v/CVE-2023-3817
      Affected range : <3.0.10-r0
      Fixed version  : 3.0.10-r0

    * MEDIUM CVE-2023-3446
      https://scout.docker.com/v/CVE-2023-3446
      Affected range : <3.0.9-r3
      Fixed version  : 3.0.9-r3

    * MEDIUM CVE-2023-2975
      https://scout.docker.com/v/CVE-2023-2975
      Affected range : <3.0.9-r2
      Fixed version  : 3.0.9-r2

    * MEDIUM CVE-2023-0466
      https://scout.docker.com/v/CVE-2023-0466
      Affected range : <3.0.8-r3
      Fixed version  : 3.0.8-r3

    * MEDIUM CVE-2023-0465
      https://scout.docker.com/v/CVE-2023-0465
      Affected range : <3.0.8-r2
      Fixed version  : 3.0.8-r2

openssl1.1-compat 1.1.1t-r1 -- 2 MEDIUM
pkg:apk/alpine/openssl1.1-compat@1.1.1t-r1?os_name=alpine&os_version=3.17

    * MEDIUM CVE-2023-3446
      https://scout.docker.com/v/CVE-2023-3446
      Affected range : <1.1.1u-r1
      Fixed version  : 1.1.1u-r1

    * MEDIUM CVE-2023-0465
      https://scout.docker.com/v/CVE-2023-0465
      Affected range : <1.1.1t-r2
      Fixed version  : 1.1.1t-r2
1 year ago
Nicolas Favre-Felix 032e5152c6
Add test for etag header on GET
Previous tests only used If-None-Match
1 year ago
Nicolas Favre-Felix 4f05cb1916
Fix 1-character markdown typo in trust docs 1 year ago
Nicolas Favre-Felix 5251109517
Update alpine base image, OpenSSL version
This addresses multiple vulnerabilities found in OpenSSL, which is
bundled in the Docker image to allow Webdis to connect to Redis over a
secure TLS connection. Full list of CVEs to be published in the
upcoming release notes for Webdis 0.1.22.
1 year ago
Nicolas Favre-Felix 496ac1aa79
Use permalink for Hiredis docs about keep-alive 1 year ago
Nicolas Favre-Felix 12e5f0363f
Add keep_alive_sec to both config files, document in README 1 year ago
Nicolas Favre-Felix e0ed93b765
Minor reformatting of prod config file 1 year ago
Nicolas Favre-Felix 8eef97288b
Fix UB warning in md5.c
Was: pointer subtraction with a null pointer
1 year ago
Nicolas Favre-Felix 90b8e2c023
Merge keep-alive contrib
Integrated as a merge commit to preserve the author's commit signatures.
1 year ago
Jessie Murray 4c335bbe8e
Add "hiredis" config block, with keep_alive_sec
Only one option available for now, as discussed.
1 year ago
Jessie Murray c7b0e4a6b7
Initialize logging earlier
slog_init() was called from server_start(), but this is kind of late
in the initialization. We should enable logging as soon as the config
is read.
1 year ago
Jessie Murray 4350a051dd
[PATCH] Allow specifying the keepalive interval
Cherry-pick commit 011f709 from hiredis, to expose
redisEnableKeepAliveWithInterval
1 year ago
Nicolas Favre-Felix 9db6459299
Fix log identification for TRACE 1 year ago
Nicolas Favre-Felix 0c4547fe5e
Update docs about Docker and Webdis
* Add section in README about Docker images and the embedded Redis
* Minor title and link changes in docs/ for Docker articles
1 year ago
Nicolas Favre-Felix 35f4900bbb
Update GitHub Actions runner
ubuntu-18.04 was turned off on April 1st, 2023.
Moving to the next version, ubuntu-20.04
1 year ago
Nicolas Favre-Felix d64478f5ee
Add docs page on running Webdis with external Redis
Inspired by the questions on issue #232. Documents what should be a
relatively common use case for Webdis users.
1 year ago
Nicolas Favre-Felix f4efbfd334
Update image versions in README after release
0.1.20 -> 0.1.21
2 years ago
Nicolas Favre-Felix 96282e1e0b
Version bump after release 2 years ago
Nicolas Favre-Felix ca5144d811
Version 0.1.21 (security update)
Security update, fixing vulnerabilities found in the Alpine Linux base
image as well as the embedded Redis service and SSL libraries.

Additionally and not related to security: fixed build issues with
CentOS 7

= Security fixes =

Urgency: HIGH

Note for the list of vulnerabilities provided below:
The "Impact" described only applies if the Webdis image is used
without changes. If Webdis is used as a base image, please review
whether the changes made to it can cause these vulnerabilities to
become exploitable.

== Critical severity ==

Description: Out-of-bounds Write in zlib (CVE-2022-37434)
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-ZLIB-2976174
Origin: zlib/zlib@1.2.11-r3, from the base image
Impact: Webdis uses zlib to support HTTP compression

== High severity ==

Description: Loop with Unreachable Exit Condition ('Infinite Loop')
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-OPENSSL-2426333
Origin: openssl/libcrypto1.1
Impact: Webdis only uses TLS to connect to Redis

Description: Execute arbitrary code via netstat (CVE-2022-28391)
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-BUSYBOX-2440608
Origin: introduced by the base image, alpine:3.14.3
Impact: netstat is not used by Webdis

Description: Arbitrary Code Injection in Redis (CVE-2022-24735)
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-REDIS-2805760
Origin: introduced by the embedded Redis service, version 6.2.6
Impact: Webdis embeds this vulnerable version of Redis

Description: NULL Pointer Dereference in LibSSL3
Info: https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-3314660
Origin: introduced by libssl3, a dependency of Redis
Impact: Webdis connects to its internal Webdis instance over TLS

Description: Double Free in LibSSL3
Info: https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-3314657
Origin: introduced by libssl3, a dependency of Redis
Impact: Webdis connects to its internal Webdis instance over TLS

Description: Access of Resource Using Incompatible Type in LibSSL3
Info: https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-3314651
Origin: introduced by libssl3, a dependency of Redis
Impact: Webdis connects to its internal Webdis instance over TLS

Description: Use After Free in LibSSL3
Info: https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-3314650
Origin: introduced by libssl3, a dependency of Redis
Impact: Webdis connects to its internal Webdis instance over TLS

Description: NULL Pointer Dereference in LibSSL3
Info: https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-3314647
Origin: introduced by libssl3, a dependency of Redis
Impact: Webdis connects to its internal Webdis instance over TLS

== Medium severity ==

Description: NULL Pointer Dereference in Redis (CVE-2022-24736)
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-REDIS-2805761
Origin: introduced by the embedded Redis service, version 6.2.6
Impact: Webdis embeds this vulnerable version of Redis

Description: Inadequate Encryption Strength in openssl (CVE-2022-2097)
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-OPENSSL-2941807
Origin: openssl/openssl@1.1.1l-r0, openssl/libssl1.1@1.1.1l-r0
Impact: Webdis only uses TLS to connect to Redis

== Low severity ==

Description: Integer Overflow or Wraparound in Redis (CVE-2022-35977)
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-REDIS-3243491
Origin: introduced by the embedded Redis service, version 6.2.6
Impact: Webdis embeds this vulnerable version of Redis

Description: Integer Overflow or Wraparound in Redis (CVE-2023-22458)
Info: https://security.snyk.io/vuln/SNYK-ALPINE314-REDIS-3243489
Origin: introduced by the embedded Redis service, version 6.2.6
Impact: Webdis embeds this vulnerable version of Redis
2 years ago
Nicolas Favre-Felix 1b63174d5d
Dependency updates: alpine, redis, ssl
Alpine: 3.14.3 -> 3.17.1
Redis: 6.2.6 -> 7.0.8
2 years ago
Nicolas Favre-Felix 5eece37333
Merge a number of fixes for CentOS 7
Webdis needed a number of small fixes to build and run on CentOS 7
(released in 2014). Initially reported in PR #231 as a missing -std=
compiler flag, there turned out to be more tweaks needed to cleanly
build and run.
2 years ago
Nicolas Favre-Felix 23838381f6
Add missing includes for strings.h
Several string functions were used without an explicit include.
This was discovered using an old version of GCC which warned about them;
these warnings are not seen with more recent compilers.
2 years ago
Nicolas Favre-Felix 2735950207
Disable pragma warning on old versions of GCC
Found with GCC 4.8.5 (released June 2015)
2 years ago
Nicolas Favre-Felix 05f168fc51
Define _POSIX_C_SOURCE=200809L
This is needed to enable localtime_r(3) used in src/slog.c
Also needed for strdup(3)
Add #ifndef to src/hiredis/fmacros.h to avoid warnings
2 years ago
Nicolas Favre-Felix 7c66f69b21
Remove O_NOFOLLOW from src/server.c
This was unnecessarily limiting, since users could legitimately want to
use a symlink for the config file. It is also unsupported on some
platforms; this was discovered when attempting to build Webdis on CentOS 7.
2 years ago
Nicolas Favre-Felix 08f0d5d7cf
Change contributed fix from gnu99 to c99 2 years ago
quocbao 50d16b16ca
Compile in C99 mode
src/websocket.c:247:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for(int i = 0; p < eom && i < cmd->count; i++) {
  ^
2 years ago
Nicolas Favre-Felix c6b9d52213
Add new docs article about loading an RDB file into a Webdis container 2 years ago
Nicolas Favre-Felix ef8fcc5bab
Update docker images in README after release 0.1.20 was published 3 years ago
Nicolas Favre-Felix 41f200477b
Version bump after release 3 years ago
Nicolas Favre-Felix a984fdb8a5
Version 0.1.20
- Smaller Docker image size
- Bugfix: avoid responding to the wrong client (this could happen in rare cases)
- Better handling of WebSocket frames (details in #212)
- Fix regression introduced in 0.1.19, causing an empty header to be sent (#217)
3 years ago
Nicolas Favre-Felix 1b6e3a95ed
Merge pull request #218 from jessie-murray/empty-header 3 years ago
Jessie Murray 055363df46
Add test with curl for empty header (#217) 3 years ago
Jessie Murray 15302e754e
Preserve header count when a value is replaced
Fix for #217, a regression added in #205. The "header_count"
field was incremented even when we overwrote a header entry, which
caused Webdis to send a header with no name and no value.
3 years ago
Nicolas Favre-Felix 73f29055c1
Improvements to ws_peek_data (by @majklik)
Better handling of WS client frames, contributed in the comments of #212:
* Reject unmasked frames as per RFC 6455
* Avoid unnecessary data copy from/to evbuffer
* Remove conditions on has_mask

2 new tests cover this change:
* minimal ping-pong with masked client frame, unmasked response
* rejected unmasked client frame
3 years ago