Skip to content

chore: sync with master#40

Merged
MichaelPlathanus merged 188 commits into
ralph/backend-tournamentsfrom
master
May 21, 2026
Merged

chore: sync with master#40
MichaelPlathanus merged 188 commits into
ralph/backend-tournamentsfrom
master

Conversation

@MichaelPlathanus
Copy link
Copy Markdown
Collaborator

No description provided.

Bulletdev and others added 30 commits April 11, 2026 16:36
fix:

Rack::Session::Cookie incorrectly handles decryption failures when configured with secrets:. If cookie decryption fails, the implementation falls back to a default decoder instead of rejecting the cookie. This allows an unauthenticated attacker to supply a crafted session cookie that is accepted as valid session data without knowledge of any configured secret.

This vulnerability affects Addressable >= 2.3.0 (note: 2.3.0 and 2.3.1 were yanked; the earliest installable release is 2.3.2). It was partially fixed in version 2.8.10 and fully remediated in 2.9.0.

The vulnerability is more exploitable on MRI Ruby < 3.2 and on all versions of JRuby and TruffleRuby. MRI Ruby 3.2 and later ship with Onigmo 6.9, which introduces memoization that prevents catastrophic backtracking for the first class of template. JRuby and TruffleRuby do not implement equivalent memoization and remain vulnerable to all patterns
 mudança no gerador de bracket

Razões técnicas:
  1. Bracket management sequencial, admin libera uma rodada de cada vez, sem paralelo
  2. Menos janela para atraso acumular
  3. Times sabem exatamente quando vão jogar (sem "você pode jogar sexta E sábado dependendo de
  resultado")
  4. O código suporta os dois, mas Modelo 2 é mais fácil de operar no MVP
Removed duplicate badges for Codacy and FOSSA.
Bulletdev and others added 25 commits May 11, 2026 04:26
Users without a Customer record in ProPay received a 404 on deposit.
  Now a find-or-create call registers the customer transparently using
  the current user's full_name and email before the deposit is proxied.
 Replace has_secure_password with a custom PasswordHasher service backed by Argon2id (m=64MiB, t=3, p=2), following the OWASP preferred profile.

  Lazy migration: existing bcrypt digests are verified as-is and silently re-hashed on the next successful login. No schema changes, no forced logouts, clean rollback.

  - Add gem argon2 ~> 2.3
  - Add Authentication::PasswordHasher with bcrypt/argon2id detection,
    rescue BCrypt::Errors::InvalidHash and Argon2::Error, test-env fast
    params (m=16, t=1, p=1)
  - Add UpgradeablePassword concern used by User and Player
  - Remove has_secure_password from User and Player; replicate presence validation and virtual attr explicitly
  - Hash via before_validation callback, not in the setter
  - Add scripts/benchmark_argon2.rb for pre-deploy calibration
  Bump jwt 3.1.2 -> 3.2.0 (inadequate authentication, HIGH)
  Bump faraday 2.14.1 -> 2.14.2 (SSRF, MEDIUM)
jwt 3.2.0 rejects nil/empty HMAC keys (CVE-2026-45363)  if
  JWT_SECRET_KEY and secret_key_base are both absent, the old code
  would silently use nil and produce cryptic 401s at request time.
  Now raises at boot so Coolify catches it in deploy logs, not in prod.

  - jwt_service.rb: tap guard raises on blank SECRET_KEY at class load
  - Dockerfile: add libargon2-dev (required native dep for argon2 gem)
  - codeql.yml: add pull-requests: write (403 when commenting on PRs
In the argon2 Ruby gem, m_cost is an exponent: memory = 2^m_cost KiB
  (valid range 3..31). Passing 65_536 (intended as KiB) caused
  ArgonHashFail on every login attempt, breaking authentication in prod.

  - m_cost: 16 => 2^16 KiB = 64 MiB (OWASP preferred, unchanged intent)
  - m_cost:  3 => 2^3  KiB = 8 KiB  (test env, replaces wrong 16 KiB)
  - Fix benchmark script output and configs to use exponent values
  - Add clarifying comment in ARGON2_PARAMS and PRD
…dation

  - Add spec/services/authentication/password_hasher_spec.rb (16 examples)
    covering hash, verify (argon2id, bcrypt legacy, blank inputs),
    needs_upgrade? and bcrypt?
  - Add spec/models/concerns/upgradeable_password_spec.rb (10 examples)
    covering the bcrypt→argon2id lazy upgrade path for User and Player,
    including that wrong passwords do not trigger digest update
  - Fix Player#player_password validation: add format check (uppercase +
    lowercase + digit) to match User#password strength requirements
  - Remove password_confirmation from :user factory — attribute no longer
    exists after has_secure_password was removed
  - Set DatabaseCleaner.allow_remote_database_url = true: the existing
    guard at rails_helper.rb:57 already blocks supabase/prod URLs; this
    allows Docker-network hostnames in local test runs
…r URLs

 The DatabaseCleaner.allow_remote_database_url flag was set to true to
  support Docker-network Postgres hostnames in local test runs. To
  compensate, extend the production URL guard to also inspect
  TEST_DATABASE_URL (the variable database.yml actually uses in test env)
  and add 'pooler' as a blocked keyword, which catches database pooler
  endpoints even if 'supabase' is absent from the URL.
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread Dockerfile
@@ -1,5 +1,5 @@
# Use Ruby 3.4.5 slim image (better Windows compatibility)
FROM ruby:3.4.5-slim
# Use Ruby 3.4.8 slim image (better Windows compatibility)
Comment thread Dockerfile
@@ -1,5 +1,5 @@
# Use Ruby 3.4.5 slim image (better Windows compatibility)
FROM ruby:3.4.5-slim
# Use Ruby 3.4.8 slim image (better Windows compatibility)
@MichaelPlathanus MichaelPlathanus merged commit e3724bc into ralph/backend-tournaments May 21, 2026
12 of 14 checks passed
@codacy-production
Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 21, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
20763950 Triggered JSON Web Token 915bab3 .pentest/scripts/27_supabase_direct_bypass.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants