Commit Graph

6952 Commits

Author SHA1 Message Date
johnnyq
556ab22c79 Enfoce Sales Permission Read on products export 2026-07-28 17:53:13 -04:00
johnnyq
78e7e1c49e Remove Normalize Scripts 2026-07-28 17:46:39 -04:00
johnnyq
c5ff3e2a3f Normalize line endings to LF; add .gitattributes and .editorconfig 2026-07-28 17:45:52 -04:00
johnnyq
7f7880a4a7 Add Quick Payments view modal in Invoices 2026-07-28 12:49:57 -04:00
johnnyq
5f3a0bec46 Remove old payments and revenues and all ties to the pages as these are combined in income now 2026-07-28 12:38:29 -04:00
johnnyq
c3896ba3d6 Add Export CSV to the new combined income page 2026-07-28 12:26:50 -04:00
johnnyq
7327ebb37c Stop parallel login attempts from bypassing the rate limits 2026-07-28 01:01:43 -04:00
johnnyq
2e855f62c9 Require credential module access to view or share credentials 2026-07-28 00:40:33 -04:00
johnnyq
4c65b8c561 Clear mail bodies after successful delivery 2026-07-28 00:18:07 -04:00
johnnyq
c64c76c577 Rotate session ID on login and fix client portal Entra SSO 2026-07-27 23:49:09 -04:00
johnnyq
22e93589cb Fix share link view accounting and quote response handling 2026-07-27 21:11:45 -04:00
johnnyq
f129311b2e Remove patch and update gitignore 2026-07-27 21:02:13 -04:00
johnnyq
70d165e8bc Claim shared item views atomically and log guest audit IPs 2026-07-27 20:58:37 -04:00
johnnyq
b555a300bc Give the vault session key full entropy and guard empty-key credential writes
generateUserSessionKey() built its AES-128 key with randomString(16), which
draws 12 random bytes and base64url-encodes them into 16 printable characters.
Those 16 characters were handed to openssl_encrypt as the 16-byte key, so the
key that wraps the site master key in the user's session carried 96 bits of
entropy instead of 128. Same for the IV.

The key and IV are now random_bytes(16) and stay raw for the cipher. Base64 is
applied only for transport - the cookie and the session copy of the IV - and
decoded again at the three read sites.

Sessions issued before this change will not decode and are not supported;
anyone logged in at deploy time is prompted to log in again. Nothing is stored
long term in this path, so there is nothing to migrate.

Also guards encryptCredentialEntry against a master key that failed to decrypt.
openssl_encrypt accepts false as a key and silently encrypts under an empty
key, so a session whose cookie had expired could write a credential that no
key would ever recover. It now returns false instead. This was reachable
before this change too, whenever a cookie expired mid-session.
2026-07-27 20:27:23 -04:00
johnnyq
829527244e Fix broken ajax 2026-07-27 20:25:48 -04:00
johnnyq
50352fb779 Revert vault session key entropy change 2026-07-27 20:13:46 -04:00
johnnyq
8dcb45fc9d Remove Patch 2026-07-27 20:00:42 -04:00
johnnyq
b18544c69b Give the vault session key full entropy and guard empty-key credential writes
generateUserSessionKey() built its AES-128 key with randomString(16), which
draws 12 random bytes and base64url-encodes them into 16 printable characters.
Those 16 characters were handed to openssl_encrypt as the 16-byte key, so the
key that wraps the site master key in the user's session carried 96 bits of
entropy instead of 128. Same for the IV.

The key and IV are now random_bytes(16) and stay raw for the cipher. Base64 is
applied only for transport - the cookie and the session copy of the IV - and
decoded again at the three read sites.

Sessions issued before this change will not decode and are not supported;
anyone logged in at deploy time is prompted to log in again. Nothing is stored
long term in this path, so there is nothing to migrate.

Also guards encryptCredentialEntry against a master key that failed to decrypt.
openssl_encrypt accepts false as a key and silently encrypts under an empty
key, so a session whose cookie had expired could write a credential that no
key would ever recover. It now returns false instead. This was reachable
before this change too, whenever a cookie expired mid-session.
2026-07-27 20:00:09 -04:00
johnnyq
8825661360 Dump new DB Structure 2026-07-27 18:38:48 -04:00
johnnyq
a4fdced10f Rate limit 2FA code attempts and narrow the TOTP acceptance window 2026-07-27 18:36:43 -04:00
johnnyq
97490bef3b Security Fix in recurring invoices in cron 2026-07-27 18:07:15 -04:00
johnnyq
a844d7b428 Adds a shared flock guard used by all five cron entry points, keyed per
script and per install. Replaces the mail queue's own lock file, which
was not atomic and could be deleted out from under a long run. Bounds
the SMTP conversation so an unresponsive server cannot hold the lock.
Recovers rows left at Sending by a run that died, which nothing
previously picked up.
2026-07-27 17:35:39 -04:00
johnnyq
686fca99e1 Fix Possible duplicate emails in a race condition in mail queue 2026-07-27 16:59:10 -04:00
johnnyq
775e8f58f6 Fix Cents Calc 2026-07-27 16:55:16 -04:00
johnnyq
409d769eb7 Scope the cron lock per install so instances don't block each other
Report an unopenable cron lock file instead of claiming cron is running
2026-07-27 16:41:21 -04:00
johnnyq
cff416dd87 Remove Patch 2026-07-27 15:22:46 -04:00
johnnyq
65de8c35e6 Prevent duplicate Stripe payment bookings and overlapping cron runs 2026-07-27 15:22:16 -04:00
johnnyq
815802fb7c Gate Admin UI Modals to Admin 2026-07-27 14:50:32 -04:00
johnnyq
53842a50d2 Add URI Tabs to mail settings keeps the tab active upon saving 2026-07-26 01:52:25 -04:00
johnnyq
5fc2f93b38 Allow negative numbers in add expense 2026-07-26 01:40:11 -04:00
johnnyq
32be252261 Remove patch file 2026-07-26 01:11:27 -04:00
johnnyq
04014da21f Combined Payments and Revenues as one View called income keeps all income in one place and still can add revenue not related to invoice 2026-07-26 01:10:52 -04:00
johnnyq
276e84ad0b Expenses: Set Current Date in new expense 2026-07-25 20:38:58 -04:00
johnnyq
cd34236716 Fix saved-payment setup Checkout: embedded_page ui_mode + attach existing Stripe customer 2026-07-25 19:00:06 -04:00
johnnyq
a26ac2c4fc Fixed adding saved credit cards in stipe due to API change 2026-07-25 18:47:13 -04:00
johnnyq
497ea3b669 Centralize client portal access checks through contactCan()
Replaces the duplicated primary/billing/technical checks across portal pages, post.php handlers, nav, and dashboard with contactCan()/enforceContactCan(). Same behavior, but the rules now live in one place instead of being copy-pasted, which is what let them drift before. file.php keeps its 404 response; ticket-visibility and approval-routing checks are intentionally left as-is.
2026-07-25 17:55:30 -04:00
johnnyq
887063394a Prevent client portal contacts from editing their own contact record 2026-07-25 17:28:57 -04:00
johnnyq
04bf3c234f Read API credential decrypt password from body instead of query string
Keeps the credential decryption secret out of the URL, so it no longer lands in web-server access logs, proxy logs, or browser history. credentials/read.php now reads api_key_decrypt_password from the request body, matching create/update. Consumers reading decrypted credentials must send it in the body, not the query string.
2026-07-25 17:08:22 -04:00
johnnyq
e6daf00528 Fix some broken API calls after RBAC update 2026-07-25 16:59:03 -04:00
johnnyq
c509b7f693 Add user-based RBAC for API keys
API keys now run as a user and inherit that user's module, operation, and client permissions. Drops per-key client scoping and removes existing keys (must be recreated). Adds an edit modal to change a key's user.
2026-07-25 16:50:58 -04:00
johnnyq
8d46e2a7db Fix Client Permission overides to include deny allow list in projects prohect and edit ticket 2026-07-25 13:28:47 -04:00
johnnyq
3756561458 Feature: Add Deny Client Access to Client Access Permssions - BREAKS UI, MUST UPDATE DB USING php scripts/cli_update.php --db_update 2026-07-25 13:22:52 -04:00
johnnyq
ff4b69b511 Client Enforcement via function on client edit instad of in sql query 2026-07-25 00:35:47 -04:00
johnnyq
761b2a7af4 Module permissions modal enforcement sweep to match its post counterpart 2026-07-25 00:28:42 -04:00
johnnyq
7a793cbbcc Add more enforceClientAccess to agent ajax gets 2026-07-24 22:51:57 -04:00
johnnyq
113ef4b9a4 Add more enforceClientAccess 2026-07-24 22:49:18 -04:00
johnnyq
3524010d7a Add enforceClientAccess to 4 bulk modals initially missing 2026-07-24 22:06:42 -04:00
johnnyq
8993bce53f Force No Indexes of empty directories even if enabled using .htaccess in uploads 2026-07-24 20:52:35 -04:00
johnnyq
8813b2c066 Use imapEngine lib for testing imap connection 2026-07-24 18:56:16 -04:00
johnnyq
5c4805b822 Neutralize CSV formula injection in generated exports using the new created escapeCsvFormula Function 2026-07-24 18:12:45 -04:00