Repository navigation
OpenMES 0.30.1 — security fix for the employee-activity API
This patch release closes an authorization bypass in the employee time-tracking API. Everyone running 0.30.0 or earlier should upgrade.
Security
Employee time records can no longer be changed by any signed-in user. The employee-activity API (/api/v1/employee-activities and /api/v1/employee-activity-custom-types) checked only that the caller was signed in, so an operator could read, change, reassign and delete any employee's time records, which feed payroll and the production cost report. It now goes through a policy:
- Admins and Supervisors read and manage every worker's records.
- Anyone else reads only the records of the worker linked to their own account: in the list, a single record and the team day view. They cannot create, change or delete records.
- Only an Admin changes the custom activity types.
Credit: reported by nsqk — thank you for the responsible disclosure.
Fixed
- Employee time record changes are audited. Every create, change and delete is written to the audit log with the user who made it and the values before and after.
- Validation is tenant-aware. A worker, work order or line from another tenant is rejected, and a custom activity type code only has to be unique within the tenant. Validation moved from the controller into Form Requests (
EmployeeActivityRequest,EmployeeActivityCustomTypeRequest), and a PATCH that changes only the start or only the end of a record is checked against the stored other end.
Changes
EmployeeActivityPolicyandEmployeeActivityCustomTypePolicy(new)EmployeeActivityController: authorization on every action, list and team-day views limited to the caller's own worker for non-managersEmployeeActivitymodel now uses theAuditabletrait- Version bumped to
v0.30.1, CHANGELOG updated
Tests
tests/Feature/Api/V1/EmployeeActivityAuthorizationTest.php — 13 tests covering the reported reproduction, role access (Admin, Supervisor, Operator with and without a linked worker), cross-tenant references, custom-type permissions, audit entries and partial-update date validation.
Upgrade
No migrations. Pull the release and restart the stack (docker compose up -d --build).
Installation
Web / self-hosted: download openmmes-v0.30.1.zip below — it is self-contained (PHP dependencies in vendor/ and the built frontend in backend/public/build/ are already bundled, so no composer install or npm build is required).
Desktop: grab the installer for your OS — Windows *-setup.exe, macOS *.dmg, or Linux *.deb / *.rpm. They bundle PHP + the backend and run OpenMES as a local app / LAN server.
Mobile (Android): install openmes-mobile-v0.30.1.apk and point it at your OpenMES server.
Shared hosting (no terminal): unzip the web package, upload the folder, point the document root at the package root, then open the URL — the browser-based setup wizard handles environment, database and the admin account.
Docker: unzip the web package and run docker compose up -d from the package root (or bash install.sh).
Changes
- fix(security): authorize the employee-activity API (7f9e1fc) — reported by nsqk
Full changelog: v0.30.0...v0.30.1