Skip to content

[pull] main from hoppscotch:main#69

Merged
pull[bot] merged 15 commits into
code:mainfrom
hoppscotch:main
May 28, 2026
Merged

[pull] main from hoppscotch:main#69
pull[bot] merged 15 commits into
code:mainfrom
hoppscotch:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 28, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

nahidhasan94 and others added 15 commits May 7, 2026 17:46
* fix(backend): prevent mass assignment in onboarding config endpoint

The unauthenticated POST /v1/onboarding/config endpoint mapped the
request body directly to InfraConfigEnum keys, allowing an attacker on
a fresh install to inject sensitive values such as JWT_SECRET and
SESSION_SECRET, enabling forged admin JWTs and full takeover.

Four independent weaknesses combined to make this exploit possible.
This commit addresses each in layers so the fix holds even if any
single layer regresses:

- main.ts: enable `whitelist: true` on the global ValidationPipe so
  properties not declared on any DTO are stripped before reaching any
  controller / service. This is the primary mitigation described in
  the advisory.

- onboarding.controller.ts: scope an additional ValidationPipe
  (`whitelist` + `forbidNonWhitelisted`) on the onboarding POST body
  so requests containing unknown fields are explicitly rejected with
  400 instead of silently dropped.

- infra-config.service.ts (updateOnboardingConfig): introduce an
  `ONBOARDING_ALLOWED_KEYS` allowlist so any `InfraConfigEnum` key
  not part of the documented onboarding surface (OAuth, SMTP) is
  dropped server-side before being persisted, even if earlier layers
  regress.

- infra-config.service.ts (validateEnvValues): explicitly reject
  `JWT_SECRET`, `SESSION_SECRET` and `ALLOW_SECURE_COOKIES` so these
  keys can never be written through any infra-config code path,
  replacing the prior `default: break` behaviour that silently
  accepted them.

Fixes GHSA-j542-4rch-8hwf

* fix(backend): harden onboarding config validation and add sensitive infra-config tests

* chore: cleanup

* chore: class validator implemented in dto layer

* fix: arguments

* fix: api feedback

---------

Co-authored-by: “mirarifhasan” <arif.ishan05@gmail.com>
* fix: class validator decorator usages

* fix: feedback
Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
Co-authored-by: gavin mcdonough <mcdgavin@users.noreply.github.com>
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
* fix: class validation issue for updateRESTUserRequest

* test: modified user-req unit test cases
Co-authored-by: cf3901646 <cf3901646@users.noreply.github.com>
Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators May 28, 2026
@pull pull Bot added the ⤵️ pull label May 28, 2026
@pull pull Bot merged commit e067ee0 into code:main May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants