Skip to content

Commit

Permalink
switch back to ring-jetty-adapter - addresses security issue (#39321)
Browse files Browse the repository at this point in the history
  • Loading branch information
piranha authored and WiNloSt committed Mar 19, 2024
1 parent 094c855 commit b003f90
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
honeysql/honeysql {:mvn/version "1.0.461" ; Transform Clojure data structures to SQL
:exclusions [org.clojure/clojurescript]}
inflections/inflections {:mvn/version "0.14.1"} ; Clojure/Script library used for prularizing words
info.sunng/ring-jetty9-adapter {:mvn/version "0.22.4"} ; Drop-in replacement for official Ring Jetty adapter. Supports Jetty 11 webserver (Jetty 12 requires JDK 17+).
instaparse/instaparse {:mvn/version "1.4.12"} ; Make your own parser
clj-commons/clj-yaml {:mvn/version "1.0.26"} ; Clojure wrapper for YAML library SnakeYAML
io.github.camsaul/toucan2 {:mvn/version "1.0.520"}
Expand Down Expand Up @@ -135,7 +134,8 @@
org.clojure/tools.namespace {:mvn/version "1.4.4"}
org.clojure/tools.reader {:mvn/version "1.3.6"}
org.clojure/tools.trace {:mvn/version "0.7.11"} ; function tracing
org.eclipse.jetty/jetty-server {:mvn/version "11.0.14"} ; web server
org.eclipse.jetty/jetty-server {:mvn/version "11.0.20"} ; web server
org.eclipse.jetty.websocket/websocket-jetty-server {:mvn/version "11.0.20"} ; ring-jetty-adapter needs that
org.flatland/ordered {:mvn/version "1.15.10"} ; ordered maps & sets
org.graalvm.js/js {:mvn/version "22.3.5"} ; JavaScript engine
org.liquibase/liquibase-core {:mvn/version "4.11.0" ; migration management (Java lib)
Expand All @@ -154,7 +154,10 @@
prismatic/schema {:mvn/version "1.4.1"} ; Data schema declaration and validation library
redux/redux {:mvn/version "0.1.4"} ; Utility functions for building and composing transducers
riddley/riddley {:mvn/version "0.2.0"} ; code walking lib -- used interally by Potemkin, manifold, etc.
ring/ring-core {:mvn/version "1.9.6"} ; web server (Jetty wrapper)
ring/ring-core {:mvn/version "1.11.0"} ; HTTP abstraction
ring/ring-jetty-adapter {:mvn/version "1.11.0" ; Jetty adapter
:exclusions [org.eclipse.jetty/jetty-server
org.eclipse.jetty.websocket/websocket-jetty-server]}
ring/ring-json {:mvn/version "0.5.1"} ; Ring middleware for reading/writing JSON automatically
slingshot/slingshot {:mvn/version "0.12.2"} ; enhanced throw/catch, used by other deps
stencil/stencil {:mvn/version "0.5.0"} ; Mustache templates for Clojure
Expand Down
2 changes: 1 addition & 1 deletion src/metabase/analytics/prometheus.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[metabase.util.log :as log]
[potemkin :as p]
[potemkin.types :as p.types]
[ring.adapter.jetty9 :as ring-jetty])
[ring.adapter.jetty :as ring-jetty])
(:import
(io.prometheus.client Collector GaugeMetricFamily)
(io.prometheus.client.hotspot GarbageCollectorExports MemoryPoolsExports StandardExports ThreadExports)
Expand Down
4 changes: 2 additions & 2 deletions src/metabase/async/streaming_response.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[metabase.util.log :as log]
[potemkin.types :as p.types]
[pretty.core :as pretty]
[ring.adapter.jetty9.common :as common]
[ring.util.jakarta.servlet :as servlet]
[ring.util.response :as response])
(:import
(java.io BufferedWriter OutputStream OutputStreamWriter)
Expand Down Expand Up @@ -189,7 +189,7 @@
(let [gzip? (should-gzip-response? request-map)
headers (cond-> (assoc (merge headers (:headers response-map)) "Content-Type" content-type)
gzip? (assoc "Content-Encoding" "gzip"))]
(#'common/set-headers response headers)
(#'servlet/set-headers response headers)
(let [output-stream-delay (output-stream-delay gzip? response)
delay-os (delay-output-stream output-stream-delay)]
(start-async-cancel-loop! request finished-chan canceled-chan)
Expand Down
4 changes: 2 additions & 2 deletions src/metabase/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
[metabase.util :as u]
[metabase.util.i18n :refer [trs]]
[metabase.util.log :as log]
[ring.adapter.jetty9 :as ring-jetty]
[ring.adapter.jetty9.servlet :as servlet])
[ring.adapter.jetty :as ring-jetty]
[ring.util.jakarta.servlet :as servlet])
(:import
(jakarta.servlet AsyncContext)
(jakarta.servlet.http HttpServletRequest HttpServletResponse)
Expand Down
2 changes: 1 addition & 1 deletion src/metabase/server/protocols.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns metabase.server.protocols
(:require
[potemkin.types :as p.types]
[ring.adapter.jetty9.servlet :as servlet]))
[ring.util.jakarta.servlet :as servlet]))

(p.types/defprotocol+ Respond
"Protocol for converting API endpoint responses to something Jetty can handle."
Expand Down
2 changes: 1 addition & 1 deletion test/metabase/api/common/internal_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[metabase.test :as mt]
[metabase.util :as u]
[metabase.util.malli.schema :as ms]
[ring.adapter.jetty9 :as jetty]))
[ring.adapter.jetty :as jetty]))

(set! *warn-on-reflection* true)

Expand Down
2 changes: 1 addition & 1 deletion test/metabase/api/geojson_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[metabase.test :as mt]
[metabase.util :as u]
[metabase.util.schema :as su]
[ring.adapter.jetty9 :as ring-jetty]
[ring.adapter.jetty :as ring-jetty]
[schema.core :as s]))

(set! *warn-on-reflection* true)
Expand Down

0 comments on commit b003f90

Please sign in to comment.