Skip to content

Fix/security hardening - #353

Merged
sotuzun merged 6 commits into
masterfrom
fix/security-hardening
Nov 23, 2026
Merged

sotuzun merged 6 commits into
masterfrom
fix/security-hardening

Conversation

@sotuzun

@sotuzun sotuzun commented Nov 20, 2026

Copy link
Copy Markdown
Member

No description provided.

- Compare webhook signatures in constant time, return false instead of
  throwing when eventTimestamp is missing, and add an overload that
  rejects webhooks outside a timestamp tolerance to limit replays.
- Exclude secret keys, card numbers, CVCs, POS passwords and 3DS keys
  from Lombok generated toString() output so they do not leak into logs.
- Require an https base URL (plain http only for loopback hosts).
- Pin GitHub Actions to commit SHAs, restrict releases to master, pass
  secrets through env instead of interpolating them into scripts, remove
  the decrypted signing key after publishing, give the CI workflow
  read-only permissions and verify the Gradle distribution checksum.
Hide cardUserKey, cardToken, expireYear, expireMonth, cardHolderName,
encryptedCard, posUsername and apiKey in the Lombok generated toString()
of request and response classes so they do not end up in logs.
…d Clock

isWebhookVerified(key, signature, data) behaves exactly as before again
(a missing eventTimestamp still throws); only the signature comparison is
now constant time. The tolerance overload reads the system clock directly.
outbound-api retries failed webhooks for up to ~44 minutes and re-sends
from the merchant panel reuse the original event time, so a timestamp
tolerance would reject legitimate deliveries. Only the constant time
signature comparison is kept.
Drop @ToString.Exclude from request and response classes for now; it will
be revisited separately. The base URL tests move to BaseUrlValidationTest.
Craftgate accepts any base URL again, as on master.
@sotuzun
sotuzun merged commit f8b81bd into master Nov 23, 2026
14 checks passed
@sotuzun
sotuzun deleted the fix/security-hardening branch November 23, 2026 12:08
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.

2 participants