Skip to content

Security tightening around logging, request paths, and cache handling#102

Open
AnnoyingTechnology wants to merge 9 commits into
gearbox-solutions:2.xfrom
AnnoyingTechnology:security-tightening
Open

Security tightening around logging, request paths, and cache handling#102
AnnoyingTechnology wants to merge 9 commits into
gearbox-solutions:2.xfrom
AnnoyingTechnology:security-tightening

Conversation

@AnnoyingTechnology
Copy link
Copy Markdown

@AnnoyingTechnology AnnoyingTechnology commented Apr 1, 2026

We use this package and we wanted to contribute a small security tightening pass that should benefit other users as well.

This PR focuses on reducing accidental exposure and hardening a few request-building paths without changing the
package’s overall shape.

  • redact FileMaker login credentials before they reach query log events
  • encode dynamic Data API path segments and validate record IDs earlier
  • add TLS config options for self-signed HTTPS setups
  • keep the Laravel 10 HTTP client fallback in place where needed
  • add optional query-log redaction for request payloads
  • reduce exception detail outside debug mode
  • sanitize container upload filenames and reject malformed upload payloads
  • replace forever-cached session tokens with a bounded TTL
  • scope guardable-column cache keys by connection to avoid collisions across shared layout names
  • add test coverage around the affected paths

Compatibility notes :

  • plain HTTP is still supported here, but it is treated as explicitly insecure
  • this branch currently bumps the PHP floor to 8.2 because of the SensitiveParameter additions and PHP's EOL.

Redact username and password before passing the login body
to logFMQuery so credentials never reach QueryExecuted
listeners. Bump minimum PHP to 8.2 and mark sensitive
method params with #[\SensitiveParameter] to keep them
out of stack traces.
Apply rawurlencode to database name, layout name, script name,
and container field name before putting them in URL paths.
Validate that record IDs are numeric.
Warn on plain HTTP unless allow_insecure_http is set.
Add verify_ssl config option for self-signed cert setups.
Apply TLS options to login, api, and disconnect requests.
Add redact_query_logs config option to mask fieldData,
portalData, globalFields and script params in query logs.
Existing logging behavior is preserved by default.
Only include layout name in exceptions when app.debug is on.
Strip null bytes, path separators and control characters
from custom upload filenames. Reject malformed file arrays
before sending.
Use bounded TTL for session tokens instead of caching forever,
defaults to 14 min (just under FM's 15 min session timeout).
Configurable via session_token_ttl.

Fix guardable-column cache key to include connection name so
two connections sharing a layout name don't collide. Fix
forceRefresh so it actually updates the static cache.
@Smef
Copy link
Copy Markdown
Member

Smef commented Apr 1, 2026

This is a lot of changes in one PR and touches a lot of different areas. We can look at some of these things if you'd like to break it into smaller units, with one fix/change/feature at a time.

@AnnoyingTechnology
Copy link
Copy Markdown
Author

AnnoyingTechnology commented Apr 1, 2026

Yeah, I was aware of that doing it.
But I split it into distinct commits that have their specific scopes.
The PR is the "whole security package", each commit touches one aspect.

If you substract the test suite foam, it's actually not that much.

edit: if that's of any value (either positive or negative), it's been reviewed by both Opus 4.6 and Codex 5.4 without complaints.

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