Permissions & Security
Currency enforces granular RBAC across financial configuration, rate synchronization, and administrative operations.
RBAC Permissions (CurrencyAccess)
Section titled “RBAC Permissions (CurrencyAccess)”| Permission | Scope |
|---|---|
currency-view |
Read-only access to Setup -> Currencies Overview, Currencies list, Live Currency Converter (./convert/), and locked Rate History (including CSV/JSON export). |
currency-manage |
Create and edit currencies, adjust spreads and sort order, export currency lists, and trigger manual rate synchronizations (./sync/). |
currency-admin |
Full administrative access including Settings, changing the base currency (./set-base/), viewing/exporting trashed currency rows, and permanently deleting non-base currencies. |
Outbound SSRF Defense (WireHttpTransport)
Section titled “Outbound SSRF Defense (WireHttpTransport)”Every external exchange rate fetch runs through Totoglu\Currency\Http\WireHttpTransport:
- HTTPS-Only & Public DNS Pinning:
assertSafePublicHttpsUrl()resolves bothAandAAAADNS records and pins the validated IP viaCURL_IPRESOLVE_V4/CURL_IPRESOLVE_V6+CURLOPT_RESOLVEto prevent DNS rebinding. - Blocked Networks: Rejects trailing-dot hosts, embedded credentials, IPv4 private/reserved ranges, CGNAT (
100.64.0.0/10), TEST-NET ranges, multicast, and non-Global-Unicast IPv6 (including IPv4-mapped::ffff:and2001:db8::/32). - Bounded Streams & Redirects: Enforces a
5_242_880-byte (MAX_RESPONSE_BYTES, 5 MiB) streamed write limit, caps manual redirects at 3 hops, and stripsAuthorization/Cookieheaders across origins.
Admin Endpoint & Entry Hardening
Section titled “Admin Endpoint & Entry Hardening”- CSRF & Method Guards:
./sync/,./convert/, and./set-base/rejectGET(405 Allow: POST), enforce$config->demoread-only protection (403), validate multi-source ProcessWire CSRF tokens, and emitCache-Control: private, no-storeJSON headers. CurrencyEntryGuard: Prevents mutatingcodeinline/bulk, blocks trashing or deleting the active base currency, and enforces reserved cookie name rejection.