Repository navigation
Upgrade to Phoenix 1.8 and clear mix hex.audit advisories - #195
Merged
Merged
Conversation
mix hex.audit reported advisories against phoenix 1.7.21, phoenix_html 4.3.0, plug 1.19.1, plug_crypto 2.1.1, plug_cowboy 2.8.0, cowboy 2.14.2, cowlib 2.16.0 and decimal 2.3.0. Upgrade to phoenix 1.8.16, phoenix_html 4.4.0, plug 1.20.3, plug_crypto 2.2.1, plug_cowboy 2.9.0, cowboy 2.20.0 and cowlib 2.21.0. The only advisory left is cowlib EEF-CVE-2026-43966, which has no fixed release yet and affects only cow_http_struct_hd encoding, which nothing here calls. - Drop the number dependency, which pinned decimal to 2.x (decimal is fixed only in 3.x). Its one use, format_number/1 in PageView, becomes a small local helper with the same output, and decimal leaves the lock. - Drop logger_file_backend and the :test_log config in test.exs. The backend was never added to Logger, so neither had any effect. - Phoenix 1.8: pass :formats and :layouts to use Phoenix.Controller in place of the deprecated :namespace, keeping the same views and layout, and stop importing the deprecated, unused get_flash. - Remove force_ssl from config/releases.exs. Phoenix 1.7 read endpoint config at compile time, so this runtime-only setting never applied. Phoenix 1.8 reads it with compile_env and refuses to boot the release on the mismatch. Removing it keeps production behaviour unchanged. - Bump the server version to 4.6.2. Signed-off-by: Rajas <panat.r@northeastern.edu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
floydtree
requested review from
mikeradka and
rmouritzen-splunk
as code owners
November 3, 2026 14:13
rmouritzen-splunk
approved these changes
Nov 3, 2026
pagbabian-splunk
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
mix hex.auditonmainreports 22 published advisories against locked dependencies. This PR upgrades Phoenix to 1.8 and the HTTP stack to releases that fix them. It also covers the Phoenix 1.8 andlogger_file_backendfollow-ups from #194.Advisories
One advisory remains: cowlib EEF-CVE-2026-43966. It's fixed in cowlib's git history, but 2.21.0 is the newest release and is still affected. It only matters when
cow_http_struct_hdencodes attacker-controlled input, and nothing in this app or its dependencies callscow_http_struct_hd. A later cowlib release will clear it.Most of these were also unreachable already. For example, the endpoint's
socket "/socket"disables both websocket and long-poll transports. Upgrading means we don't have to argue reachability for each one.Changes
mix.exs/mix.lock:phoenix ~> 1.8.16,phoenix_html ~> 4.4,plug_cowboy ~> 2.9, thenmix deps.update --allandmix deps.unlock --unused. The floors keep the fixed versions as minimums. Other minor bumps come along: telemetry, ranch, phoenix_pubsub, phoenix_template, phoenix_live_reload 1.7, websock_adapter 0.7, credo, and sobelow 0.18.number(and with itdecimal): decimal's fixes exist only in 3.x, andnumberpins it to 2.x. The app usednumberonce,format_number/1inSchemaWeb.PageView, to add thousands separators. That's now a two-clause local helper with the same output, for example0-65,535on/data_types. Jason only uses decimal optionally, so decimal leaves the lock.logger_file_backend: it was never wired up.config/test.exsconfigured a:test_logbackend, but nothing added it to Logger's backends. The dead config is gone too.use Phoenix.Controllernow passesformats: [html: "View", json: "View"], layouts: [html: SchemaWeb.LayoutView]instead of the deprecatednamespace: SchemaWeb. This is the compatibility form Phoenix suggests, and it resolves the same view and layout modules as before. The view helper no longer imports the deprecated, unusedget_flash.force_sslfromconfig/releases.exs: under Phoenix 1.7 the endpoint read its config at compile time, so this runtime-only setting never took effect. I checked: today's release serves plain HTTP for a non-localhostHostwith a200, no redirect and no HSTS. Phoenix 1.8 readsforce_sslwithApplication.compile_env, so leaving the line in makes the release (and the Docker image) refuse to boot with a compile-time/runtime config mismatch. Removing it keeps production behaviour exactly as it is. Turning on HTTP→HTTPS redirects can be a separate, deliberate change inconfig/prod.exs.@version: 4.6.1 → 4.6.2.What users will notice
Browser pages get a new header from Phoenix 1.8's
put_secure_browser_headers:content-security-policy: base-uri 'self'; frame-ancestors 'self';. The deprecatedx-frame-options: SAMEORIGINandx-download-options: noopenheaders are no longer sent. Third-party framing stays blocked, now throughframe-ancestors. Nothing else changes.Testing
All runs used Elixir 1.19.7 / OTP 28.5.0.8 from
.tool-versions.mix compile --warnings-as-errors: passes with no app warnings.mix hex.audit: reports only cowlib EEF-CVE-2026-43966.mainand this branch side by side inMIX_ENV=prodwith the same compiled 1.10.0-dev schema, and fetched 42 routes, plus 3 random/sample/*routes compared by status only. Those covered all browser pages (including one class, object, profile and category,/dictionary,/data_typesand/visualizer), the/api/*,/schema/*,/export/*and/docroutes, 404s, andPOST /api/validateand/api/v2/validate.maindiffer the same way, so that ordering is per-VM map iteration order, not this change.MIX_ENV=prod mix releasebuilt like theDockerfile(withconfig/releases.exsasruntime.exsand a generated certificate) boots and serves HTTP and HTTPS on Phoenix 1.8.16 / Plug 1.20.3 / Cowboy 2.20.0. Before theforce_sslremoval it aborted at boot.🤖 Generated with Claude Code