Giter Club home page Giter Club logo

svalinn's Introduction

Svalinn

(pronounced “svæ-lin”)

Build Status Dependency Updateer codecov.io Go Report Card Quality Gate Status Apache V2 License GitHub Release

Summary

Svalinn has an endpoint that receives events as WRP Messages. The service parses these events and inserts them into the database. It also optionally registers to an endpoint to receive events. For more information on how Svalinn fits into codex, check out the codex README.

For registering to an endpoint, Svalinn is capable of registering to Caduceus, a part of XMiDT.

Table of Contents

Code of Conduct

This project and everyone participating in it are governed by the XMiDT Code Of Conduct. By participating, you agree to this Code.

Details

Svalinn has two main functions: registering for events and inserting events into the database. It also has a health endpoint that reports as unhealthy when it can't connect to or ping the database.

MsgPack is used multiple time in Svalinn, specifically ugorji's implementation.

Svalinn utilizes the bascule and wrp-listener packages for webhook registration and request authentication.

Registering for events

Whether or not Svalinn registers to a webhook for events is determined by the configurable webhook registration interval. So long as the interval is greater than 0, the registerer will register at the interval given.

When the registerer contacts the webhook, it includes the following information:

  • URL: where to send the events
  • Content type: what to set as the message's content type and how to send events to Svalinn. Svalinn by default requests for a wrp, which will come as a MsgPack.
  • Secret: the secret the webhook should use when sending events to Svalinn. Svalinn uses it to validate the message. If this is an empty string, Svalinn doesn't authenticate the messages it receives against a hash of the message.
  • Retries: the number of times to retry if sending an event fails.
  • Alternative URLs: other URLs to try if sending an event fails.
  • Device IDs: list of regular expressions to match device id type against. Currently, this defaults to [".*"].
  • Events: list of regular expressions for the webhook to use to determine which events to send to Svalinn.

The registerer sends an authorization header with its request, and determines what that should be based on configuration values. It's possible to not send any authorization header.

Registering is done using the wrp-listener package.

Inserting events into the database

When an event is sent to Svalinn's endpoint, it is initially validated, parsed into a record to be stored in the database, then inserted as part of a batch insert into the database.

Validation

In order to ensure that the event was sent from a trusted source, Svalinn gets a SHA1 hash from a request header (the header name is configurable) then creates its own hash using the secret that it sends when registering and the body of the request. If the two hashes match, the event is considered valid.
This validation is done using bascule middleware, and is bypassed if the configurable header and secret are empty strings.

If the request passes through the middleware successfully, the body is decoded from MsgPack into the wrp.Message struct: our event!

Now that the event has been verified and decoded, Svalinn attempts to add it to the parsing queue. If the queue is full, Svalinn returns the Too Many Requests (429) status code, drops the message, and records it as dropped in metrics.
Otherwise, Svalinn adds the event to the queue and returns the Accepted (202) status code.

Parsing (and Encryption)

A goroutine watches the parsing queue and spawns other goroutines to parse the events it finds on the queue into the records we will store in the database.
There is a configurable maximum number of workers to parse the incoming events.

A worker parsing a request runs the following steps:

  1. Checks to see if there are any rules relating to this event's Destination. If a rule's regular expression matches, the rule provides guidance on what the event type of the event's record should be, the TTL for the record, and whether or not to store the payload of the event. Rules are declared in Svalinn's configuration.
  2. Parses the event's Destination to determine the device id, which is added to the record we are going to store.
  3. Determines if the record is in the blacklist.
  4. Checks that the Type is what we expect.
  5. Gets a timestamp from the Payload for the record's birth date. If a timestamp isn't found, Svalinn creates a new one from the current time. The worker also takes the time and adds the TTL for the record in order to find the death date, which is when the record has expired and should be deleted. If a TTL isn't decided by a rule, the (configurable) default TTL is used. Both the birth date and death date are added to the record.
  6. Determines if the event's Payload and Metadata should be stored. The Payload is not stored by default unless it is part of a rule enabling the storage of the Payload. However, if its size is bigger than the configured max size allowed, it isn't stored. The Metadata is stored by default unless it is larger than the configured max size allowed. If the Payload or Metadata shouldn't be stored, they are stripped from the event.
  7. The event (possibly without Metadata and Payload) is encoded into a MsgPack.
  8. If an encryption has been set up, we encrypt the encoded event and add it to the record we plan to insert into the database. If there is no encryption, the encoded event is added to the record.

If any of these steps fail, the worker drops the message, records the drop and the reason in metrics, and then finishes.

At this point, if the worker succeeded, the record has the following information:

  • Type
  • DeviceID
  • BirthDate
  • DeathDate
  • Data (the encoded/encrypted event)
  • Nonce (for the encryption)
  • Alg (for the encryption)
  • KID (for the encryption)

The worker adds the record to the inserting queue, blocking until it succeeds. Once it succeeds, it finishes so a new goroutine can parse a new event.

Batch Insertion

A goroutine watches the inserting queue. When it finds a record, a timer starts while the goroutine waits for more records. If it reaches the configurable maximum batch size, it spawns a worker to batch insert that group of records. The timer that started was the maximum time the goroutine will wait until spawning a goroutine to batch insert the records it has gathered. When the timer goes off, the goroutine spawns a worker to batch insert its records, even though it didn't hit the max batch size yet. The number of maximum inserting workers at a time is a configurable value. If there are no workers available, the goroutine will block until it is able to spawn a new worker to batch insert the records it has.

The spawned worker will attempt to insert the records. Depending on the configuration, it may retry a set number of times. If it ultimately fails, it will count the number of records in the batch and record that number of dropped events in metrics. When the worker is done, it finishes so a new goroutine can do a new insertion.

Build

Source

In order to build from the source, you need a working Go environment with version 1.11 or greater. Find more information on the Go website.

You can directly use go get to put the Svalinn binary into your GOPATH:

GO111MODULE=on go get github.com/xmidt-org/svalinn

You can also clone the repository yourself and build using make:

mkdir -p $GOPATH/src/github.com/xmidt-org
cd $GOPATH/src/github.com/xmidt-org
git clone [email protected]:xmidt-org/codex-svalinn.git
cd svalinn
make build

Makefile

The Makefile has the following options you may find helpful:

  • make build: builds the Svalinn binary
  • make docker: builds a docker image for Svalinn, making sure to get all dependencies
  • make local-docker: builds a docker image for Svalinn with the assumption that the dependencies can be found already
  • make it: runs make docker, then deploys Svalinn and a cockroachdb database into docker.
  • make test: runs unit tests with coverage for Svalinn
  • make clean: deletes previously-built binaries and object files

RPM

First have a local clone of the source and go into the root directory of the repository. Then use rpkg to build the rpm:

rpkg srpm --spec <repo location>/<spec file location in repo>
rpkg -C <repo location>/.config/rpkg.conf sources --outdir <repo location>'

Docker

The docker image can be built either with the Makefile or by running a docker command. Either option requires first getting the source code.

See Makefile on specifics of how to build the image that way.

For running a command, either you can run docker build after getting all dependencies, or make the command fetch the dependencies. If you don't want to get the dependencies, run the following command:

docker build -t svalinn:local -f deploy/Dockerfile .

If you want to get the dependencies then build, run the following commands:

GO111MODULE=on go mod vendor
docker build -t svalinn:local -f deploy/Dockerfile.local .

For either command, if you want the tag to be a version instead of local, then replace local in the docker build command.

Kubernetes

WIP. TODO: add info

Deploy

For deploying on Docker or in Kubernetes, refer to the deploy README.

For running locally, ensure you have the binary built. If it's in your GOPATH, run:

svalinn

If the binary is in your current folder, run:

./svalinn

Contributing

Refer to CONTRIBUTING.md.

svalinn's People

Contributors

denopink avatar dependabot[bot] avatar j-mai avatar kcajmagic avatar kristakhare avatar kristinapathak avatar mtrinh11 avatar schmidtw avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

svalinn's Issues

Lower error level of device id on blacklist log msg

These log messages are being logged at the error level, but I think warning or info would be more appropriate:

{"caller":"requestParser.go:184","error":"device is in blacklist","level":"error","msg":"Failed to create record","reason":"bad mac, flapping","ts":"2019-12-17T22:51:37.246224178Z"}

request parser becoming more and more complex

func (r *RequestParser) parseRequest(request WrpWithTime) {

type RequestParser struct {

The parseRequest() function is getting pretty long, and then the struct itself seems pretty complex, with many dependencies. It would be helpful to try to split up this functionality in some way to help decrease the complexity and make it easier to maintain.

Rename master branch to main

Also have to change references to the branch in .travis.yml, README, and CONTRIBUTING. Double check any other markdown files as well - sometimes links have the branch name in them.

Error parsing Bearer Token

Hey hey! :)

So i'm diving into Installing the Codex and I've some doubts that might explain an error i'm getting.

If I understand correctly the registrationURL should be tr1d1um/api/v3/hook, correct? I believe it could also be Caduceus/hook but for some strange reason I keep getting 404 and tr1d1um is currently working ok for a side app I have.

Now I'm trying to use JWT all over the WebPA stack and it seems to work ok for the most part expect for svalling that I keep getting

{"error":"error parsing bearer token from http response body: unable to parse bearer token: invalid character 'e' looking for beginning of value","level":"error","msg":"Failed to register webhook","ts":"2022-07-12T18:17:11.527149403Z"}

In my svalinn 0.14.3 configuration I have this setup:

########################################
#   Webhook Registration Related Configuration
########################################

# webhook provides the information needed to register to a webhook.  If the 
# urls and event regex aren't empty and the interval is greater than 0, 
# registration occurs.
# (Optional)
webhook:
  # registrationInterval provides the time to wait between each registration to 
  # the webhook.  If this is set to 0, no registration is done.
  # (Optional)
  registrationInterval: "4m"

  # timeout provides the length of time the request should wait before timing 
  # out.
  timeout: "1m"

  # registrationURL provides the place to register the webhook.
  registrationURL: "http://tr1d1um.namespace:443/api/v3/hook"

  # request provides the information passed in the webhook registration request.
  request:
    # config provides configuration values for the requests to the webhook 
    # receiver.
    config:
      # url provides the server the webhook should send the events to.  If this 
      # value isn't set, no registration happens.
      url: "http://svalinn.namespace:7100/api/v1/device-status"

      # contentType provides the content type Svalinn expects from the requests 
      # it receives.
      # (Optional) defaults to "wrp"
      contentType: "wrp"

      # maxRetryCount is the number of times to retry on a failure.
      # (Optional)
      maxRetryCount: 3

    # events provides a list of regular expressions that tells the webhook 
    # which endpoints to send to Svalinn.  If the destination of an event 
    # matches a regular expression in this list, it is sent to Svalinn
    events: [".*"]

  # jwt provides a way to use Bearer Authorization when registering to a 
  # webhook.  If the below values are all provided, a request is made to the 
  # URL to get the token to be used in the registration request.  The 
  # header would look like: 
  # 
  # Authorization Bearer {token}
  # 
  # (Optional)
  jwt:
    # requestHeaders are added to the request for the token.
    # (Optional)
    # requestHeaders:
    #   "": ""

    # authURL is the URL to access for the token.
    authURL: "http://themis.namespace:6501/issue"

    # timeout is how long the request to get the token will take before 
    # timing out.
    timeout: "1m"

    # buffer is the length of time before a token expires to get a new token.
    # (Optional)
    buffer: "2m"

Any help on this matter would be highly appreciated :D

Make rules more generic

Rules are used to determine whether or not to parse the device id from the source or destination of the wrp. If the device id should be parsed from the destination, the rule should have a regular expression stating how to parse the destination. As long as that isn't empty, the destination should be used to get the device id for events following that rule. For any events with rules not specifying a regular expression or events that don't have a rule, the source should be used.

CVE-2023-48795 (Medium) detected in golang.org/x/crypto-v0.0.0-20220824171710-5757bc0c5503 - autoclosed

CVE-2023-48795 - Medium Severity Vulnerability

Vulnerable Library - golang.org/x/crypto-v0.0.0-20220824171710-5757bc0c5503

Library home page: https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20220824171710-5757bc0c5503.zip

Path to dependency file: /go.mod

Path to vulnerable library: /go/pkg/mod/cache/download/golang.org/x/crypto/@v/v0.0.0-20220824171710-5757bc0c5503.mod

Dependency Hierarchy:

  • github.com/xmidt-org/bascule-v0.11.0 (Root Library)
    • github.com/xmidt-org/clortho-v0.0.4
      • github.com/lestrrat-go/jwx/v2-v2.0.6
        • golang.org/x/crypto-v0.0.0-20220824171710-5757bc0c5503 (Vulnerable Library)

Found in base branch: main

Vulnerability Details

The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remote attackers to bypass integrity checks such that some packets are omitted (from the extension negotiation message), and a client and server may consequently end up with a connection for which some security features have been downgraded or disabled, aka a Terrapin attack. This occurs because the SSH Binary Packet Protocol (BPP), implemented by these extensions, mishandles the handshake phase and mishandles use of sequence numbers. For example, there is an effective attack against SSH's use of ChaCha20-Poly1305 (and CBC with Encrypt-then-MAC). The bypass occurs in [email protected] and (if CBC is used) the [email protected] MAC algorithms. This also affects Maverick Synergy Java SSH API before 3.1.0-SNAPSHOT, Dropbear through 2022.83, Ssh before 5.1.1 in Erlang/OTP, PuTTY before 0.80, AsyncSSH before 2.14.2, golang.org/x/crypto before 0.17.0, libssh before 0.10.6, libssh2 through 1.11.0, Thorn Tech SFTP Gateway before 3.4.6, Tera Term before 5.1, Paramiko before 3.4.0, jsch before 0.2.15, SFTPGo before 2.5.6, Netgate pfSense Plus through 23.09.1, Netgate pfSense CE through 2.7.2, HPN-SSH through 18.2.0, ProFTPD before 1.3.8b (and before 1.3.9rc2), ORYX CycloneSSH before 2.3.4, NetSarang XShell 7 before Build 0144, CrushFTP before 10.6.0, ConnectBot SSH library before 2.2.22, Apache MINA sshd through 2.11.0, sshj through 0.37.0, TinySSH through 20230101, trilead-ssh2 6401, LANCOM LCOS and LANconfig, FileZilla before 3.66.4, Nova before 11.8, PKIX-SSH before 14.4, SecureCRT before 9.4.3, Transmit5 before 5.10.4, Win32-OpenSSH before 9.5.0.0p1-Beta, WinSCP before 6.2.2, Bitvise SSH Server before 9.32, Bitvise SSH Client before 9.33, KiTTY through 0.76.1.13, the net-ssh gem 7.2.0 for Ruby, the mscdex ssh2 module before 1.15.0 for Node.js, the thrussh library before 0.35.1 for Rust, and the Russh crate before 0.40.2 for Rust.

Publish Date: 2023-12-18

URL: CVE-2023-48795

CVSS 3 Score Details (5.9)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: High
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: High
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://security-tracker.debian.org/tracker/CVE-2023-48795

Release Date: 2023-12-18

Fix Resolution: putty - 0.80, openssh - V_9_6_P1, golang/crypto - v0.17.0, asyncssh - 2.14.2, libssh-0.9.8, libssh-0.10.6, teraterm - v5.1, paramiko - 3.4.0, russh - 0.40.2, com.github.mwiede:jsch:0.2.15, proftpd - v1.3.8b, thrussh - 0.35.1, teraterm - v5.1, org.connectbot:sshlib:2.2.22, mscdex/ssh2 - 1.15.0, jtesta/ssh-audit - v3.1.0, Oryx-Embedded/CycloneSSH - v2.3.4, opnsense/src - 23.7, winscp - 6.2.2, PowerShell/openssh-portable - v9.5.0.0


Step up your Open Source Security Game with Mend here

CVE-2021-43565 (High) detected in github.com/golang/crypto-c084706c2272f3d44b722e988e70d4a58e60e7f4 - autoclosed

CVE-2021-43565 - High Severity Vulnerability

Vulnerable Library - github.com/golang/crypto-c084706c2272f3d44b722e988e70d4a58e60e7f4

[mirror] Go supplementary cryptography libraries

Dependency Hierarchy:

  • github.com/xmidt-org/voynicrypto-v0.1.1 (Root Library)
    • github.com/golang/crypto-c084706c2272f3d44b722e988e70d4a58e60e7f4 (Vulnerable Library)

Found in HEAD commit: 9f5964432916f8bb2d183050ee7cfacbda90184b

Found in base branch: main

Vulnerability Details

There's an input validation flaw in golang.org/x/crypto's readCipherPacket() function. An unauthenticated attacker who sends an empty plaintext packet to a program linked with golang.org/x/crypto/ssh could cause a panic, potentially leading to denial of service.

Publish Date: 2021-11-10

URL: CVE-2021-43565

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://nvd.nist.gov/vuln/detail/CVE-2021-43565

Release Date: 2021-11-10

Fix Resolution: golang-golang-x-crypto-dev - 1:0.0~git20211202.5770296-1;golang-go.crypto-dev - 1:0.0~git20211202.5770296-1


Step up your Open Source Security Game with Mend here

CVE-2020-26160 (High) detected in github.com/dgrijalva/jwt-go-dc14462fd58732591c7fa58cc8496d6824316a82 - autoclosed

CVE-2020-26160 - High Severity Vulnerability

Vulnerable Library - github.com/dgrijalva/jwt-go-dc14462fd58732591c7fa58cc8496d6824316a82

Golang implementation of JSON Web Tokens (JWT)

Dependency Hierarchy:

  • github.com/xmidt-org/webpa-common/basculechecks-d66f2f5d2f9ad210345162797adadb34957a1077 (Root Library)
    • github.com/xmidt-org/bascule-ff62e83fdf196e5cc82e6762a622cbf617b54c5a
      • github.com/dgrijalva/jwt-go-dc14462fd58732591c7fa58cc8496d6824316a82 (Vulnerable Library)

Found in HEAD commit: 58189d1723e3c6dc778f7d750766616829978ff2

Found in base branch: main

Vulnerability Details

jwt-go before 4.0.0-preview1 allows attackers to bypass intended access restrictions in situations with []string{} for m["aud"] (which is allowed by the specification). Because the type assertion fails, "" is the value of aud. This is a security problem if the JWT token is presented to a service that lacks its own audience check.

Publish Date: 2020-09-30

URL: CVE-2020-26160

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: None
    • Availability Impact: None

For more information on CVSS3 Scores, click here.


Step up your Open Source Security Game with WhiteSource here

CVE-2023-49290 (Medium) detected in github.com/lestrrat-go/jwx/v2-v2.0.6 - autoclosed

CVE-2023-49290 - Medium Severity Vulnerability

Vulnerable Library - github.com/lestrrat-go/jwx/v2-v2.0.6

Implementation of various JWx (Javascript Object Signing and Encryption/JOSE) technologies

Library home page: https://proxy.golang.org/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.zip

Path to dependency file: /go.mod

Path to vulnerable library: /go/pkg/mod/cache/download/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.mod

Dependency Hierarchy:

  • github.com/xmidt-org/bascule-v0.11.0 (Root Library)
    • github.com/xmidt-org/clortho-v0.0.4
      • github.com/lestrrat-go/jwx/v2-v2.0.6 (Vulnerable Library)

Found in base branch: main

Vulnerability Details

lestrrat-go/jwx is a Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies. A p2c parameter set too high in JWE's algorithm PBES2-* could lead to a denial of service. The JWE key management algorithms based on PBKDF2 require a JOSE Header Parameter called p2c (PBES2 Count). This parameter dictates the number of PBKDF2 iterations needed to derive a CEK wrapping key. Its primary purpose is to intentionally slow down the key derivation function, making password brute-force and dictionary attacks more resource- intensive. Therefore, if an attacker sets the p2c parameter in JWE to a very large number, it can cause a lot of computational consumption, resulting in a denial of service. This vulnerability has been addressed in commit 64f2a229b which has been included in release version 1.2.27 and 2.0.18. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Publish Date: 2023-12-05

URL: CVE-2023-49290

CVSS 3 Score Details (5.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: Low

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.cve.org/CVERecord?id=CVE-2023-49290

Release Date: 2023-12-04

Fix Resolution: v1.2.27,v2.0.18


Step up your Open Source Security Game with Mend here

CVE-2024-24786 (Medium) detected in google.golang.org/protobuf-v1.28.1 - autoclosed

CVE-2024-24786 - Medium Severity Vulnerability

Vulnerable Library - google.golang.org/protobuf-v1.28.1

Go support for Google's protocol buffers

Library home page: https://proxy.golang.org/google.golang.org/protobuf/@v/v1.28.1.zip

Path to dependency file: /go.mod

Path to vulnerable library: /go.mod

Dependency Hierarchy:

  • github.com/xmidt-org/bascule-v0.11.0 (Root Library)
    • github.com/prometheus/client_golang-v1.13.0
      • google.golang.org/protobuf-v1.28.1 (Vulnerable Library)

Found in base branch: main

Vulnerability Details

The protojson.Unmarshal function can enter an infinite loop when unmarshaling certain forms of invalid JSON. This condition can occur when unmarshaling into a message which contains a google.protobuf.Any value, or when the UnmarshalOptions.DiscardUnknown option is set.

Publish Date: 2024-03-05

URL: CVE-2024-24786

CVSS 3 Score Details (6.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://pkg.go.dev/vuln/GO-2024-2611

Release Date: 2024-03-05

Fix Resolution: v1.33.0


Step up your Open Source Security Game with Mend here

Bump bascule

then remove duplicated code for getting the webhook auth

CVE-2022-27191 (High) detected in github.com/golang/crypto-c084706c2272f3d44b722e988e70d4a58e60e7f4 - autoclosed

CVE-2022-27191 - High Severity Vulnerability

Vulnerable Library - github.com/golang/crypto-c084706c2272f3d44b722e988e70d4a58e60e7f4

[mirror] Go supplementary cryptography libraries

Dependency Hierarchy:

  • github.com/xmidt-org/voynicrypto-v0.1.1 (Root Library)
    • github.com/golang/crypto-c084706c2272f3d44b722e988e70d4a58e60e7f4 (Vulnerable Library)

Found in HEAD commit: 9f5964432916f8bb2d183050ee7cfacbda90184b

Found in base branch: main

Vulnerability Details

The golang.org/x/crypto/ssh package before 0.0.0-20220314234659-1baeb1ce4c0b for Go allows an attacker to crash a server in certain circumstances involving AddHostKey.

Publish Date: 2022-03-18

URL: CVE-2022-27191

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://nvd.nist.gov/vuln/detail/CVE-2022-27191

Release Date: 2022-03-18

Fix Resolution: golang-golang-x-crypto-dev - 1:0.0~git20220315.3147a52-1;golang-go.crypto-dev - 1:0.0~git20220315.3147a52-1


Step up your Open Source Security Game with Mend here

Blacklist

svalinn checks a regex blacklist kept in the database at a configurable interval. It keeps the blacklist up to date, and with each event sent, it runs the list of regex values against the destination provided.

WS-2023-0177 (Medium) detected in github.com/lestrrat-go/jwx/v2-v2.0.6 - autoclosed

WS-2023-0177 - Medium Severity Vulnerability

Vulnerable Library - github.com/lestrrat-go/jwx/v2-v2.0.6

Implementation of various JWx (Javascript Object Signing and Encryption/JOSE) technologies

Library home page: https://proxy.golang.org/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.zip

Path to dependency file: /go.mod

Path to vulnerable library: /go/pkg/mod/cache/download/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.mod

Dependency Hierarchy:

  • github.com/xmidt-org/bascule-v0.11.0 (Root Library)
    • github.com/xmidt-org/clortho-v0.0.4
      • github.com/lestrrat-go/jwx/v2-v2.0.6 (Vulnerable Library)

Found in base branch: main

Vulnerability Details

github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack

Publish Date: 2023-06-14

URL: WS-2023-0177

CVSS 3 Score Details (5.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: None
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-rm8v-mxj3-5rmq

Release Date: 2023-06-14

Fix Resolution: v1.2.26,v2.0.11


Step up your Open Source Security Game with Mend here

CVE-2024-28122 (Medium) detected in github.com/lestrrat-go/jwx/v2-v2.0.6 - autoclosed

CVE-2024-28122 - Medium Severity Vulnerability

Vulnerable Library - github.com/lestrrat-go/jwx/v2-v2.0.6

Implementation of various JWx (Javascript Object Signing and Encryption/JOSE) technologies

Library home page: https://proxy.golang.org/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.zip

Path to dependency file: /go.mod

Path to vulnerable library: /go/pkg/mod/cache/download/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.mod

Dependency Hierarchy:

  • github.com/xmidt-org/bascule-v0.11.0 (Root Library)
    • github.com/xmidt-org/clortho-v0.0.4
      • github.com/lestrrat-go/jwx/v2-v2.0.6 (Vulnerable Library)

Found in base branch: main

Vulnerability Details

JWX is Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies. This vulnerability allows an attacker with a trusted public key to cause a Denial-of-Service (DoS) condition by crafting a malicious JSON Web Encryption (JWE) token with an exceptionally high compression ratio. This issue has been patched in versions 1.2.29 and 2.0.21.

Publish Date: 2024-03-09

URL: CVE-2024-28122

CVSS 3 Score Details (6.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: High
    • User Interaction: None
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-hj3v-m684-v259

Release Date: 2024-03-09

Fix Resolution: lestrrat-go/jwx-v1.2.29,v2.0.21


Step up your Open Source Security Game with Mend here

CVE-2024-21664 (High) detected in github.com/lestrrat-go/jwx/v2-v2.0.6 - autoclosed

CVE-2024-21664 - High Severity Vulnerability

Vulnerable Library - github.com/lestrrat-go/jwx/v2-v2.0.6

Implementation of various JWx (Javascript Object Signing and Encryption/JOSE) technologies

Library home page: https://proxy.golang.org/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.zip

Path to dependency file: /go.mod

Path to vulnerable library: /go/pkg/mod/cache/download/github.com/lestrrat-go/jwx/v2/@v/v2.0.6.mod

Dependency Hierarchy:

  • github.com/xmidt-org/bascule-v0.11.0 (Root Library)
    • github.com/xmidt-org/clortho-v0.0.4
      • github.com/lestrrat-go/jwx/v2-v2.0.6 (Vulnerable Library)

Found in base branch: main

Vulnerability Details

jwx is a Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies. Calling jws.Parse with a JSON serialized payload where the signature field is present while protected is absent can lead to a nil pointer dereference. The vulnerability can be used to crash/DOS a system doing JWS verification. This vulnerability has been patched in versions 2.0.19 and 1.2.28.

Publish Date: 2024-01-09

URL: CVE-2024-21664

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-pvcr-v8j8-j5q3

Release Date: 2024-01-09

Fix Resolution: v1.2.28, v2.0.19


Step up your Open Source Security Game with Mend here

CVE-2022-28948 (High) detected in github.com/go-yaml/yaml-v3.0.0 - autoclosed

CVE-2022-28948 - High Severity Vulnerability

Vulnerable Library - github.com/go-yaml/yaml-v3.0.0

YAML support for the Go language.

Dependency Hierarchy:

  • github.com/stretchr/testify-v1.7.0 (Root Library)
    • github.com/go-yaml/yaml-v3.0.0 (Vulnerable Library)

Found in HEAD commit: 9f5964432916f8bb2d183050ee7cfacbda90184b

Found in base branch: main

Vulnerability Details

An issue in the Unmarshal function in Go-Yaml v3 causes the program to crash when attempting to deserialize invalid input.

Publish Date: 2022-05-19

URL: CVE-2022-28948

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-hp87-p4gw-j4gq

Release Date: 2022-05-19

Fix Resolution: 3.0.0


Step up your Open Source Security Game with Mend here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.