Conversation
|
Task linked: HF-116 Hardocoded trial license-key |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Trial license key never expires, behaves as permanent
- Moved trial key from permanent license branch to separate expiration check with hardcoded expiry date (May 19, 2026).
Or push these changes by commenting:
@cursor push 199420175a
Preview (199420175a)
diff --git a/src/helpers/licenseKeyValidator.ts b/src/helpers/licenseKeyValidator.ts
--- a/src/helpers/licenseKeyValidator.ts
+++ b/src/helpers/licenseKeyValidator.ts
@@ -54,9 +54,23 @@
vars: {},
}
- if (licenseKey === 'gpl-v3' || licenseKey === 'internal-use-in-handsontable' || licenseKey === 'hftrial-0168e-1f2b7-47158-70b05-0842f') {
+ if (licenseKey === 'gpl-v3' || licenseKey === 'internal-use-in-handsontable') {
messageDescriptor.template = LicenseKeyValidityState.VALID
+ } else if (licenseKey === 'hftrial-0168e-1f2b7-47158-70b05-0842f') {
+ const [day, month, year] = (process.env.HT_RELEASE_DATE || '').split('/')
+ const releaseDays = Math.floor(new Date(`${month}/${day}/${year}`).getTime() / 8.64e7)
+ const trialExpiryDate = new Date('05/19/2026')
+ const trialExpiryDays = Math.floor(trialExpiryDate.getTime() / 8.64e7)
+
+ messageDescriptor.vars.keyValidityDate = formatDate(trialExpiryDate)
+
+ if (releaseDays > trialExpiryDays) {
+ messageDescriptor.template = LicenseKeyValidityState.EXPIRED
+ } else {
+ messageDescriptor.template = LicenseKeyValidityState.VALID
+ }
+
} else if (typeof licenseKey === 'string' && checkKeySchema(licenseKey)) {
const [day, month, year] = (process.env.HT_RELEASE_DATE || '').split('/')
const releaseDays = Math.floor(new Date(`${month}/${day}/${year}`).getTime() / 8.64e7)This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 755686a. Configure here.
| } | ||
|
|
||
| if (licenseKey === 'gpl-v3' || licenseKey === 'internal-use-in-handsontable') { | ||
| if (licenseKey === 'gpl-v3' || licenseKey === 'internal-use-in-handsontable' || licenseKey === 'hftrial-0168e-1f2b7-47158-70b05-0842f') { |
There was a problem hiding this comment.
Trial license key never expires, behaves as permanent
High Severity
The new hftrial-… key is placed in the same branch as gpl-v3 and internal-use-in-handsontable, which unconditionally sets the state to VALID without any expiration check. Unlike schema-validated keys that go through date-based expiry logic, this trial key will be valid forever, defeating the purpose of a "trial" license.
Reviewed by Cursor Bugbot for commit 755686a. Configure here.
There was a problem hiding this comment.
let's keep it like that
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1649 +/- ##
========================================
Coverage 97.19% 97.19%
========================================
Files 173 173
Lines 15013 15013
Branches 3209 3209
========================================
Hits 14592 14592
Misses 421 421
🚀 New features to boost your workflow:
|
Performance comparison of head (755686a) vs base (ca0bb89) |



Context
https://app.clickup.com/t/9015210959/HF-116
How did you test your changes?
unit tests
Types of changes
Checklist:
Note
Medium Risk
Adds a hardcoded license key bypass in validation logic; if misused or left in production it can undermine licensing enforcement.
Overview
License validation now treats an additional hardcoded trial key as always valid. Specifically,
checkLicenseKeyValidityinlicenseKeyValidator.tswhitelistshftrial-0168e-1f2b7-47158-70b05-0842falongside the existing special-case keys, bypassing schema/expiry checks for that value.Reviewed by Cursor Bugbot for commit 755686a. Bugbot is set up for automated code reviews on this repo. Configure here.