@lunora/advisor 1.0.0-alpha.34 → 1.0.0-alpha.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/index.d.mts +61 -1
  2. package/dist/index.d.ts +61 -1
  3. package/dist/index.mjs +1 -200
  4. package/dist/packem_shared/AE_METRIC_EVENTS-LP_0D7Uw.mjs +1 -0
  5. package/dist/packem_shared/actionFetchSsrf-BbWxy1Yf.mjs +1 -0
  6. package/dist/packem_shared/adminRouteWithoutGuard-DSo4t9j4.mjs +1 -0
  7. package/dist/packem_shared/aiRawRunEscapeHatch-DfhjYm43.mjs +1 -0
  8. package/dist/packem_shared/aiToolSideEffectPromptInjection-DnWQOoKi.mjs +1 -0
  9. package/dist/packem_shared/aiUnboundedGenerationPublic-D3HZrh5_.mjs +1 -0
  10. package/dist/packem_shared/allowUnauthenticatedShardAccessEnabled-D4aMNBb0.mjs +1 -0
  11. package/dist/packem_shared/argument-derived-sink-BpO3NPPM.mjs +1 -0
  12. package/dist/packem_shared/authApiCallWithoutHeaders-BItMMdZP.mjs +1 -0
  13. package/dist/packem_shared/authCsrfCheckDisabled-De9ammtV.mjs +1 -0
  14. package/dist/packem_shared/authEmailVerificationDisabled-BFKdJcx4.mjs +1 -0
  15. package/dist/packem_shared/authSecureCookiesDisabled-B4WIzvMm.mjs +1 -0
  16. package/dist/packem_shared/authSessionFreshageZero-Bpcaf_Pe.mjs +1 -0
  17. package/dist/packem_shared/authTrustedOriginsWildcard-DjU9NXEm.mjs +1 -0
  18. package/dist/packem_shared/browserAllowPrivateTargets-Dxyeh6lg.mjs +1 -0
  19. package/dist/packem_shared/browserUserUrlWithoutAllowlist-BHBS6b0N.mjs +1 -0
  20. package/dist/packem_shared/circularFk-BMuJKmuZ.mjs +1 -0
  21. package/dist/packem_shared/constraintValidator-N339mfyx.mjs +1 -0
  22. package/dist/packem_shared/containerInstanceKeyFromUserInput-C8S4T3ty.mjs +1 -0
  23. package/dist/packem_shared/containerOversizedInstance-B9wW_sU5.mjs +1 -0
  24. package/dist/packem_shared/containerPublicInternet-Bx2J7tha.mjs +1 -0
  25. package/dist/packem_shared/containerRuntimeEgressRelaxation-BQ2ZD1aV.mjs +1 -0
  26. package/dist/packem_shared/containerStartEnableInternetOverride-B62WUura.mjs +1 -0
  27. package/dist/packem_shared/dedupeCacheKeys-7JgxaQWV.mjs +1 -0
  28. package/dist/packem_shared/duplicateIndex-DFT7qLQD.mjs +1 -0
  29. package/dist/packem_shared/emptyIndex-BiXEfyfN.mjs +1 -0
  30. package/dist/packem_shared/exportSinkMisconfigured-DvpAaa6j.mjs +1 -0
  31. package/dist/packem_shared/externalSourceIncrementalNoDeletePath-DnoL64YY.mjs +1 -0
  32. package/dist/packem_shared/externalSourceOnGlobal-DNPLoNUg.mjs +1 -0
  33. package/dist/packem_shared/externalSourceUnscoped-DqBp5jYr.mjs +1 -0
  34. package/dist/packem_shared/filterWithoutIndex-ht2GZQWV.mjs +1 -0
  35. package/dist/packem_shared/finding-BAVgqnCF.mjs +1 -0
  36. package/dist/packem_shared/fk-index-Bmk19RvQ.mjs +1 -0
  37. package/dist/packem_shared/flagGatesSecurityWithUnsafeDefault-DPGFEHTt.mjs +1 -0
  38. package/dist/packem_shared/fromServerSchema-CJ-AQ2kw.mjs +1 -0
  39. package/dist/packem_shared/geoIndexFieldNotGeopoint-DAGLZtaH.mjs +1 -0
  40. package/dist/packem_shared/geoIndexUnused-BgDE6_AR.mjs +1 -0
  41. package/dist/packem_shared/hardcodedSecret-rIRc3aNk.mjs +1 -0
  42. package/dist/packem_shared/helpers-DwlvEUCh.mjs +1 -0
  43. package/dist/packem_shared/hotShard-DVs_U17R.mjs +1 -0
  44. package/dist/packem_shared/httpActionMissingAuthGuard-BZDdeW_D.mjs +1 -0
  45. package/dist/packem_shared/httpActionResponseHeaderInjection-D063rB7U.mjs +1 -0
  46. package/dist/packem_shared/hyperdriveOutsideAction-CRmOQz67.mjs +1 -0
  47. package/dist/packem_shared/identityUndeclaredClaimTrusted-BYRYGQ74.mjs +1 -0
  48. package/dist/packem_shared/imagesUrlSourceFromUserInput-Cy5pc_dA.mjs +1 -0
  49. package/dist/packem_shared/indexReferencesUnknownField-r3QHlaz6.mjs +1 -0
  50. package/dist/packem_shared/indexUtilization-QfbIH_w4.mjs +1 -0
  51. package/dist/packem_shared/insertManyUnsafeUserData-DrH7PdRs.mjs +1 -0
  52. package/dist/packem_shared/kvUnscopedUserKeyIdor-B4lGxRxh.mjs +1 -0
  53. package/dist/packem_shared/mailInboundDispatchWithoutVerify-BivYJ5F9.mjs +1 -0
  54. package/dist/packem_shared/mailRecipientFromRequestInput-BR_oSh65.mjs +1 -0
  55. package/dist/packem_shared/maskUncoveredPiiColumn-DqPfZM2O.mjs +1 -0
  56. package/dist/packem_shared/maskWeakHashStrategyOnPii-CEiiGgT7.mjs +1 -0
  57. package/dist/packem_shared/maskedRelationLeakViaWith-CxYk0MDW.mjs +1 -0
  58. package/dist/packem_shared/mutatorFullRowReplace-CEgecSGm.mjs +1 -0
  59. package/dist/packem_shared/nondeterministicQueryMutation-BaMfbAk_.mjs +1 -0
  60. package/dist/packem_shared/normalizeIdUsedAsAuthorization-FjISSXJm.mjs +1 -0
  61. package/dist/packem_shared/notifyMissingPushConfig-C_GbVw3S.mjs +1 -0
  62. package/dist/packem_shared/notifySendOutsideAction-B0jZuUP3.mjs +1 -0
  63. package/dist/packem_shared/outputProjectionMissingOnPublicRead-9Pm9766s.mjs +1 -0
  64. package/dist/packem_shared/ownerFieldFromArgsNotAuth-BoR9vvst.mjs +1 -0
  65. package/dist/packem_shared/paymentCreateWithoutAuthorize-CurtqN8K.mjs +1 -0
  66. package/dist/packem_shared/paymentWebhookWideTolerance-I7ingfR8.mjs +1 -0
  67. package/dist/packem_shared/plaintextSecretInWranglerVariables-DXjKIm8H.mjs +1 -0
  68. package/dist/packem_shared/policyReferencesUnknownTable-D3WelAQa.mjs +1 -0
  69. package/dist/packem_shared/privilegedDispatchUnvalidatedPayload-74GuGye1.mjs +1 -0
  70. package/dist/packem_shared/privilegedFanoutFromPublicProcedure-C2j2GSUN.mjs +1 -0
  71. package/dist/packem_shared/publicArgumentUsesAny-BJb4cTqL.mjs +1 -0
  72. package/dist/packem_shared/publicMutationWithoutRatelimit-D9phluHW.mjs +1 -0
  73. package/dist/packem_shared/publicTableRlsOptoutConfusion-CaWtPGAn.mjs +1 -0
  74. package/dist/packem_shared/queueWithoutDlq-BLY3iy9Q.mjs +1 -0
  75. package/dist/packem_shared/r2sqlOutsideAction-CKK_I1Ms.mjs +1 -0
  76. package/dist/packem_shared/ratelimitDefaultMemoryStore-mOdI3Jmb.mjs +1 -0
  77. package/dist/packem_shared/ratelimitKeySpoofableOrGlobal-DaGId_Fh.mjs +1 -0
  78. package/dist/packem_shared/ratelimitMiddlewareFailOpen-CTWVosEc.mjs +1 -0
  79. package/dist/packem_shared/relationReferencesUnknownField-clqyB69Y.mjs +1 -0
  80. package/dist/packem_shared/relationReferencesUnknownTable-CLdrhkmS.mjs +1 -0
  81. package/dist/packem_shared/rlsUncoveredTable-DYHgnoos.mjs +1 -0
  82. package/dist/packem_shared/shapeTargetsGlobalTable-Blz-aSkg.mjs +1 -0
  83. package/dist/packem_shared/shapeUnknownTable-DFxtyFio.mjs +1 -0
  84. package/dist/packem_shared/signupMutationWithoutDisposableGating-3ir808Vz.mjs +1 -0
  85. package/dist/packem_shared/softDeleteIncludeDeletedFromArgs-DgxpQHRA.mjs +1 -0
  86. package/dist/packem_shared/sqlInjectionRisk-D2NaT-5c.mjs +1 -0
  87. package/dist/packem_shared/storageGenerateUploadUrlNoContentTypePin-C9cjl6Jh.mjs +1 -0
  88. package/dist/packem_shared/storageKeyFromUserArgs-BeS5cp56.mjs +1 -0
  89. package/dist/packem_shared/storagePresignedUrlForPrivateContent-j7VhwIdu.mjs +1 -0
  90. package/dist/packem_shared/storageUploadWithoutContentTypeAllowlist-oxKLecuf.mjs +1 -0
  91. package/dist/packem_shared/storageUploadWithoutMaxSize-DUDxPutk.mjs +1 -0
  92. package/dist/packem_shared/tableWithoutInsert-D3AhaNzR.mjs +1 -0
  93. package/dist/packem_shared/ttlFieldNotTimestamp-BFiRkSZD.mjs +1 -0
  94. package/dist/packem_shared/unboundedStringArgument-AkkIcr-S.mjs +1 -0
  95. package/dist/packem_shared/unindexedForeignKey-DK4eWXkb.mjs +1 -0
  96. package/dist/packem_shared/unindexedRelationTarget-B5fFq1E8.mjs +1 -0
  97. package/dist/packem_shared/unrestrictedWhereBranch-YKiydie4.mjs +1 -0
  98. package/dist/packem_shared/userCreatingMutationWithoutCaptcha-iDjRkUFO.mjs +1 -0
  99. package/dist/packem_shared/vectorsNamespaceFromUserInput-Cyq5B2kF.mjs +1 -0
  100. package/dist/packem_shared/workflowDuplicateStepName-cXF6Rpvg.mjs +1 -0
  101. package/dist/packem_shared/workflowUnknownTarget-JF8rITLP.mjs +1 -0
  102. package/dist/packem_shared/workflowUnused-Dx_FQwGE.mjs +1 -0
  103. package/package.json +2 -2
  104. package/dist/packem_shared/AE_METRIC_EVENTS-BM14d0lm.mjs +0 -87
  105. package/dist/packem_shared/actionFetchSsrf-wbmYgzmz.mjs +0 -26
  106. package/dist/packem_shared/adminRouteWithoutGuard-UUGBkAjU.mjs +0 -33
  107. package/dist/packem_shared/aiRawRunEscapeHatch-C29jd32J.mjs +0 -26
  108. package/dist/packem_shared/aiToolSideEffectPromptInjection-BtD3alqB.mjs +0 -33
  109. package/dist/packem_shared/aiUnboundedGenerationPublic-CbAcSxLB.mjs +0 -26
  110. package/dist/packem_shared/allowUnauthenticatedShardAccessEnabled-BcASq-jP.mjs +0 -30
  111. package/dist/packem_shared/argument-derived-sink-C1xTTqAt.mjs +0 -30
  112. package/dist/packem_shared/authApiCallWithoutHeaders-BeJhCZaf.mjs +0 -38
  113. package/dist/packem_shared/authCsrfCheckDisabled-DCf9FSoD.mjs +0 -26
  114. package/dist/packem_shared/authEmailVerificationDisabled-Dk-Tc5oU.mjs +0 -26
  115. package/dist/packem_shared/authSecureCookiesDisabled-osJrHW9Y.mjs +0 -26
  116. package/dist/packem_shared/authSessionFreshageZero-CjufCc_Q.mjs +0 -26
  117. package/dist/packem_shared/authTrustedOriginsWildcard-ylv4PKzC.mjs +0 -26
  118. package/dist/packem_shared/browserAllowPrivateTargets-CBvQxLAM.mjs +0 -26
  119. package/dist/packem_shared/browserUserUrlWithoutAllowlist-CvhA6w59.mjs +0 -26
  120. package/dist/packem_shared/circularFk-CNcAVuYa.mjs +0 -127
  121. package/dist/packem_shared/constraintValidator-CxwtpJ6E.mjs +0 -206
  122. package/dist/packem_shared/containerInstanceKeyFromUserInput-BUXj2J4w.mjs +0 -19
  123. package/dist/packem_shared/containerOversizedInstance-5U1VKPRM.mjs +0 -36
  124. package/dist/packem_shared/containerPublicInternet-CuNerJE5.mjs +0 -30
  125. package/dist/packem_shared/containerRuntimeEgressRelaxation-B0LlfmDA.mjs +0 -26
  126. package/dist/packem_shared/containerStartEnableInternetOverride-DDaHZQ1L.mjs +0 -26
  127. package/dist/packem_shared/dedupeCacheKeys-r5B7u_yq.mjs +0 -13
  128. package/dist/packem_shared/duplicateIndex-BOublMSt.mjs +0 -57
  129. package/dist/packem_shared/emptyIndex-BX8EuEY7.mjs +0 -32
  130. package/dist/packem_shared/exportSinkMisconfigured-897sVMUa.mjs +0 -46
  131. package/dist/packem_shared/externalSourceIncrementalNoDeletePath-DvX9cRBD.mjs +0 -45
  132. package/dist/packem_shared/externalSourceOnGlobal-Bg-NfCX9.mjs +0 -30
  133. package/dist/packem_shared/externalSourceUnscoped-5vT-Bup3.mjs +0 -44
  134. package/dist/packem_shared/filterWithoutIndex-BYVeJaSs.mjs +0 -31
  135. package/dist/packem_shared/finding-Dm_zvzS1.mjs +0 -16
  136. package/dist/packem_shared/fk-index-IUK1ukgs.mjs +0 -7
  137. package/dist/packem_shared/flagGatesSecurityWithUnsafeDefault-BhIs0shr.mjs +0 -41
  138. package/dist/packem_shared/fromServerSchema-CVnbSf8j.mjs +0 -70
  139. package/dist/packem_shared/geoIndexFieldNotGeopoint-CcaInLhY.mjs +0 -40
  140. package/dist/packem_shared/geoIndexUnused-D7I0UyND.mjs +0 -40
  141. package/dist/packem_shared/hardcodedSecret-Be-pKVdn.mjs +0 -31
  142. package/dist/packem_shared/helpers-BySnKhVB.mjs +0 -31
  143. package/dist/packem_shared/hotShard-CkC7qpre.mjs +0 -60
  144. package/dist/packem_shared/httpActionMissingAuthGuard-CxipddNx.mjs +0 -35
  145. package/dist/packem_shared/httpActionResponseHeaderInjection-DOFS7pFT.mjs +0 -39
  146. package/dist/packem_shared/hyperdriveOutsideAction-BgZqX7Xg.mjs +0 -30
  147. package/dist/packem_shared/identityUndeclaredClaimTrusted-D8nXV2dd.mjs +0 -32
  148. package/dist/packem_shared/imagesUrlSourceFromUserInput-YcDQ0b_Y.mjs +0 -19
  149. package/dist/packem_shared/indexReferencesUnknownField-BSWNngxX.mjs +0 -36
  150. package/dist/packem_shared/indexUtilization-B5DMQ3bI.mjs +0 -45
  151. package/dist/packem_shared/insertManyUnsafeUserData-Dn77XpmX.mjs +0 -26
  152. package/dist/packem_shared/kvUnscopedUserKeyIdor-YWwmfE8X.mjs +0 -19
  153. package/dist/packem_shared/mailInboundDispatchWithoutVerify-CHSRA8zz.mjs +0 -28
  154. package/dist/packem_shared/mailRecipientFromRequestInput-Cka2qu5J.mjs +0 -26
  155. package/dist/packem_shared/maskUncoveredPiiColumn-DjGIPG6M.mjs +0 -61
  156. package/dist/packem_shared/maskWeakHashStrategyOnPii-1c4q8Opf.mjs +0 -35
  157. package/dist/packem_shared/maskedRelationLeakViaWith-CPI4s0sl.mjs +0 -76
  158. package/dist/packem_shared/mutatorFullRowReplace-BJnNDaIV.mjs +0 -26
  159. package/dist/packem_shared/nondeterministicQueryMutation-GXES1fLp.mjs +0 -35
  160. package/dist/packem_shared/normalizeIdUsedAsAuthorization-BVPtCpzT.mjs +0 -50
  161. package/dist/packem_shared/notifyMissingPushConfig-Ca9EzRzy.mjs +0 -27
  162. package/dist/packem_shared/notifySendOutsideAction-BUZSIZa4.mjs +0 -30
  163. package/dist/packem_shared/outputProjectionMissingOnPublicRead-Bl5IMx0k.mjs +0 -51
  164. package/dist/packem_shared/ownerFieldFromArgsNotAuth-mOw3hE5z.mjs +0 -26
  165. package/dist/packem_shared/paymentCreateWithoutAuthorize-BYm4JLxo.mjs +0 -26
  166. package/dist/packem_shared/paymentWebhookWideTolerance-D9QQJMJq.mjs +0 -35
  167. package/dist/packem_shared/plaintextSecretInWranglerVariables-NKO4YkKf.mjs +0 -35
  168. package/dist/packem_shared/policyReferencesUnknownTable-DtaIEovd.mjs +0 -38
  169. package/dist/packem_shared/privilegedDispatchUnvalidatedPayload-5Forjckt.mjs +0 -37
  170. package/dist/packem_shared/privilegedFanoutFromPublicProcedure-D3dL01B8.mjs +0 -26
  171. package/dist/packem_shared/publicArgumentUsesAny-C71b2NCf.mjs +0 -32
  172. package/dist/packem_shared/publicMutationWithoutRatelimit-DbIhgi7j.mjs +0 -36
  173. package/dist/packem_shared/publicTableRlsOptoutConfusion-Bn71yoD4.mjs +0 -38
  174. package/dist/packem_shared/queueWithoutDlq-CSkGNb_0.mjs +0 -41
  175. package/dist/packem_shared/r2sqlOutsideAction-CtqxvMuV.mjs +0 -30
  176. package/dist/packem_shared/ratelimitDefaultMemoryStore-BISChG5C.mjs +0 -26
  177. package/dist/packem_shared/ratelimitKeySpoofableOrGlobal-DqlHYQQ3.mjs +0 -26
  178. package/dist/packem_shared/ratelimitMiddlewareFailOpen-CJgDCaUw.mjs +0 -33
  179. package/dist/packem_shared/relationReferencesUnknownField-CjbLScJ1.mjs +0 -54
  180. package/dist/packem_shared/relationReferencesUnknownTable-DrorpKYe.mjs +0 -33
  181. package/dist/packem_shared/rlsUncoveredTable-CxEfZ5eZ.mjs +0 -56
  182. package/dist/packem_shared/shapeTargetsGlobalTable-DHrf4Koi.mjs +0 -34
  183. package/dist/packem_shared/shapeUnknownTable-C8aDWFoe.mjs +0 -34
  184. package/dist/packem_shared/signupMutationWithoutDisposableGating-Dnbol2CS.mjs +0 -39
  185. package/dist/packem_shared/softDeleteIncludeDeletedFromArgs-BLqDKrkM.mjs +0 -38
  186. package/dist/packem_shared/sqlInjectionRisk-zwytYGLt.mjs +0 -26
  187. package/dist/packem_shared/storageGenerateUploadUrlNoContentTypePin-Da4L9Ge8.mjs +0 -26
  188. package/dist/packem_shared/storageKeyFromUserArgs-B86elJgS.mjs +0 -19
  189. package/dist/packem_shared/storagePresignedUrlForPrivateContent-yGmb8uqz.mjs +0 -47
  190. package/dist/packem_shared/storageUploadWithoutContentTypeAllowlist-BV-gF1lT.mjs +0 -27
  191. package/dist/packem_shared/storageUploadWithoutMaxSize-DpxO59wU.mjs +0 -27
  192. package/dist/packem_shared/tableWithoutInsert-CbbaYIP4.mjs +0 -34
  193. package/dist/packem_shared/ttlFieldNotTimestamp-Dpaj63Z6.mjs +0 -36
  194. package/dist/packem_shared/unboundedStringArgument-DThg2-wt.mjs +0 -32
  195. package/dist/packem_shared/unindexedForeignKey-BgJbKyqK.mjs +0 -45
  196. package/dist/packem_shared/unindexedRelationTarget-D6eyj6Xx.mjs +0 -53
  197. package/dist/packem_shared/userCreatingMutationWithoutCaptcha-2DZtWIPb.mjs +0 -42
  198. package/dist/packem_shared/vectorsNamespaceFromUserInput-CQhr5bVn.mjs +0 -19
  199. package/dist/packem_shared/workflowDuplicateStepName-ioBxPBCy.mjs +0 -48
  200. package/dist/packem_shared/workflowUnknownTarget-Cdd7WhKQ.mjs +0 -34
  201. package/dist/packem_shared/workflowUnused-D0jHxdz9.mjs +0 -38
@@ -1,26 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const sqlInjectionRisk = {
4
- categories: ["SECURITY"],
5
- description: "A `ctx.sql` tagged-template interpolates an unparameterized string-building expression (concatenation or nested template) instead of a bound value — splicing raw text into the query and reopening SQL injection.",
6
- facing: "EXTERNAL",
7
- level: "ERROR",
8
- name: "sql_injection_risk",
9
- remediation: "Pass the value through a bound placeholder so the driver parameterizes it — keep request input inside a `ctx.sql` placeholder instead of concatenating it into the query string. Never build SQL text from request input by hand.",
10
- run: (context) => {
11
- if (context.sqlInterpolations === void 0) {
12
- return [];
13
- }
14
- return context.sqlInterpolations.map(
15
- (interpolation) => emit(sqlInjectionRisk, {
16
- cacheKey: `sql_injection_risk:${interpolation.file}:${interpolation.line.toString()}`,
17
- detail: `\`ctx.sql\` in \`${interpolation.exportName}\` (${interpolation.file}:${interpolation.line.toString()}) interpolates a string-building expression instead of a bound value — a SQL-injection vector. Pass the value through a bound placeholder so the driver parameterizes it.`,
18
- metadata: { exportName: interpolation.exportName, file: interpolation.file, line: interpolation.line }
19
- })
20
- );
21
- },
22
- source: "static",
23
- title: "Possible SQL injection in ctx.sql interpolation"
24
- };
25
-
26
- export { sqlInjectionRisk as default };
@@ -1,26 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const storageGenerateUploadUrlNoContentTypePin = {
4
- categories: ["SECURITY"],
5
- description: "A `ctx.storage.generateUploadUrl(key, …)` call has no `contentType` pin, so the signed PUT URL it mints authorizes any content-type/size the client chooses — `upload()`'s `allowedContentTypes`/`maxSize` guards never run for a client-side PUT against this URL.",
6
- facing: "EXTERNAL",
7
- level: "WARN",
8
- name: "storage_generate_upload_url_no_content_type_pin",
9
- remediation: "Pass `contentType` to `ctx.storage.generateUploadUrl(key, { contentType })` so the signature only authorizes a PUT with that exact content-type. If the client's upload size/type also needs bounding, prefer `upload()`/`store()` (with `allowedContentTypes`/`maxSize`) over a client-side signed PUT.",
10
- run: (context) => {
11
- if (context.storageUploads === void 0) {
12
- return [];
13
- }
14
- return context.storageUploads.filter((row) => row.method === "generateUploadUrl" && row.analyzable && !row.presentKeys.includes("contentType")).map(
15
- (row) => emit(storageGenerateUploadUrlNoContentTypePin, {
16
- cacheKey: `storage_generate_upload_url_no_content_type_pin:${row.file}:${row.line.toString()}`,
17
- detail: `\`ctx.storage.generateUploadUrl\` in \`${row.exportName}\` (${row.file}:${row.line.toString()}) has no \`contentType\` pin — the signed PUT it mints accepts any type/size, minted client-side and bypassing \`upload()\`'s guards.`,
18
- metadata: { exportName: row.exportName, file: row.file, line: row.line }
19
- })
20
- );
21
- },
22
- source: "static",
23
- title: "generateUploadUrl signed PUT with no content-type pin"
24
- };
25
-
26
- export { storageGenerateUploadUrlNoContentTypePin as default };
@@ -1,19 +0,0 @@
1
- import { m as makeArgumentDerivedSinkLint } from './argument-derived-sink-C1xTTqAt.mjs';
2
-
3
- const storageKeyFromUserArgs = makeArgumentDerivedSinkLint({
4
- cacheKey: (access) => `storage_key_from_user_args:${access.file}:${access.line.toString()}`,
5
- categories: ["SECURITY"],
6
- description: "A `ctx.storage.*` call uses an R2 object key taken directly from the handler's `args` with no server-side scoping. The bucket methods key by the caller-supplied string, so any caller can read, overwrite, or delete another user's object — object-level IDOR.",
7
- detail: (access) => `\`ctx.storage.*.${access.method}\` in \`${access.exportName}\` (${access.file}:${access.line.toString()}) uses an object key derived from \`args\` with no server-side scoping — any caller can read/overwrite/delete another user's object (IDOR). Prefix the key with a server-trusted identity (e.g. \`\${ctx.auth.userId}/…\`) or resolve the object through an owned record.`,
8
- facing: "EXTERNAL",
9
- getAccesses: (context) => context.storageKeyAccesses,
10
- level: "ERROR",
11
- metadata: (access) => {
12
- return { exportName: access.exportName, file: access.file, line: access.line, method: access.method };
13
- },
14
- name: "storage_key_from_user_args",
15
- remediation: `Prefix the object key with a server-trusted identity (e.g. \`\${ctx.auth.userId}/…\`) or resolve the object through a record the caller is known to own. Never pass request input straight through as an R2 object key.`,
16
- title: "R2 object key taken directly from user args (IDOR)"
17
- });
18
-
19
- export { storageKeyFromUserArgs as default };
@@ -1,47 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const SIGNER_METHODS = /* @__PURE__ */ new Set(["getPresignedUrl", "getSignedUrl"]);
4
- const NEAR_MAX_EXPIRES_THRESHOLD_SECONDS = 6 * 24 * 60 * 60;
5
- const isNativePresignedCall = (row) => row.method === "getPresignedUrl";
6
- const isNearExpiryCeiling = (row) => SIGNER_METHODS.has(row.method) && row.expiresInSeconds !== void 0 && row.expiresInSeconds >= NEAR_MAX_EXPIRES_THRESHOLD_SECONDS;
7
- const storagePresignedUrlForPrivateContent = {
8
- categories: ["SECURITY"],
9
- description: "`ctx.storage.getPresignedUrl(...)` mints a native S3 SigV4 URL that resolves directly against R2, bypassing the Worker's auth/RLS/rate-limit entirely — the wrong choice for private or policy-gated content. Either signer minting an `expiresInSeconds` near the shared 7-day ceiling also hands out a long-lived bearer credential.",
10
- facing: "EXTERNAL",
11
- level: "WARN",
12
- name: "storage_presigned_url_for_private_content",
13
- remediation: "For private/per-user/policy-gated content, use `getSignedUrl` (resolves back through the Worker, so your auth/RLS/rate-limit gates still run) instead of `getPresignedUrl`. Reserve `getPresignedUrl` for genuinely public or bulk content. On either signer, keep `expiresInSeconds` as short as the use case allows — well under the 7-day ceiling — rather than minting a near-maximum-lifetime URL.",
14
- run: (context) => {
15
- if (context.storageUploads === void 0) {
16
- return [];
17
- }
18
- return context.storageUploads.filter((row) => isNativePresignedCall(row) || isNearExpiryCeiling(row)).map((row) => {
19
- const native = isNativePresignedCall(row);
20
- const nearCeiling = isNearExpiryCeiling(row);
21
- const location = `\`${row.exportName}\` (${row.file}:${row.line.toString()})`;
22
- let detail;
23
- if (native && nearCeiling) {
24
- detail = `\`ctx.storage.getPresignedUrl\` in ${location} mints a native S3 SigV4 URL — bypasses the Worker's auth/RLS/rate-limit entirely — with an \`expiresInSeconds\` of ${(row.expiresInSeconds ?? 0).toString()}s, near the 7-day signing ceiling.`;
25
- } else if (native) {
26
- detail = `\`ctx.storage.getPresignedUrl\` in ${location} mints a native S3 SigV4 URL that resolves directly against R2, bypassing the Worker's auth/RLS/rate-limit entirely. Use \`getSignedUrl\` for app-gated access to private content.`;
27
- } else {
28
- detail = `\`ctx.storage.${row.method}\` in ${location} requests an \`expiresInSeconds\` of ${(row.expiresInSeconds ?? 0).toString()}s, near the 7-day signing ceiling — a leaked link stays valid for almost a week.`;
29
- }
30
- return emit(storagePresignedUrlForPrivateContent, {
31
- cacheKey: `storage_presigned_url_for_private_content:${row.file}:${row.line.toString()}`,
32
- detail,
33
- metadata: {
34
- expiresInSeconds: row.expiresInSeconds,
35
- exportName: row.exportName,
36
- file: row.file,
37
- line: row.line,
38
- method: row.method
39
- }
40
- });
41
- });
42
- },
43
- source: "static",
44
- title: "Native presigned URL or near-max-TTL signed URL for private content"
45
- };
46
-
47
- export { storagePresignedUrlForPrivateContent as default };
@@ -1,27 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const UPLOAD_METHODS = /* @__PURE__ */ new Set(["store", "upload"]);
4
- const storageUploadWithoutContentTypeAllowlist = {
5
- categories: ["SECURITY"],
6
- description: "A `ctx.storage.upload`/`store` call has no `allowedContentTypes` allowlist, so an uploader can store any content-type — including `text/html` or `image/svg+xml` — which, served back from `publicBaseUrl`, is a stored-XSS vector against your own origin.",
7
- facing: "EXTERNAL",
8
- level: "WARN",
9
- name: "storage_upload_without_content_type_allowlist",
10
- remediation: 'Pass `allowedContentTypes: ["image/png", "image/jpeg", …]` to `ctx.storage.upload`/`store` so an uploaded object\'s `contentType` must match an approved list. Reject anything HTML/SVG/script-executable unless the app genuinely needs to serve it.',
11
- run: (context) => {
12
- if (context.storageUploads === void 0) {
13
- return [];
14
- }
15
- return context.storageUploads.filter((row) => UPLOAD_METHODS.has(row.method) && row.analyzable && !row.presentKeys.includes("allowedContentTypes")).map(
16
- (row) => emit(storageUploadWithoutContentTypeAllowlist, {
17
- cacheKey: `storage_upload_without_content_type_allowlist:${row.file}:${row.line.toString()}`,
18
- detail: `\`ctx.storage.${row.method}\` in \`${row.exportName}\` (${row.file}:${row.line.toString()}) has no \`allowedContentTypes\` allowlist — any content-type is accepted, including \`text/html\`/\`image/svg+xml\`, a stored-XSS risk if the object is served from \`publicBaseUrl\`.`,
19
- metadata: { exportName: row.exportName, file: row.file, line: row.line, method: row.method }
20
- })
21
- );
22
- },
23
- source: "static",
24
- title: "Storage upload with no content-type allowlist"
25
- };
26
-
27
- export { storageUploadWithoutContentTypeAllowlist as default };
@@ -1,27 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const UPLOAD_METHODS = /* @__PURE__ */ new Set(["store", "upload"]);
4
- const storageUploadWithoutMaxSize = {
5
- categories: ["SECURITY"],
6
- description: "A `ctx.storage.upload`/`store` call has no `maxSize` cap, so a caller can push an unbounded body straight into R2 through the Worker — unbounded storage/billing exhaustion, and for a streamed body, unbounded worker time.",
7
- facing: "EXTERNAL",
8
- level: "WARN",
9
- name: "storage_upload_without_max_size",
10
- remediation: "Pass a `maxSize` (bytes) to `ctx.storage.upload`/`store` sized to the largest legitimate object the app accepts. `ArrayBuffer`/`Blob` bodies are rejected up front when oversized; a `ReadableStream` body is aborted mid-transfer once the limit is exceeded.",
11
- run: (context) => {
12
- if (context.storageUploads === void 0) {
13
- return [];
14
- }
15
- return context.storageUploads.filter((row) => UPLOAD_METHODS.has(row.method) && row.analyzable && !row.presentKeys.includes("maxSize")).map(
16
- (row) => emit(storageUploadWithoutMaxSize, {
17
- cacheKey: `storage_upload_without_max_size:${row.file}:${row.line.toString()}`,
18
- detail: `\`ctx.storage.${row.method}\` in \`${row.exportName}\` (${row.file}:${row.line.toString()}) has no \`maxSize\` cap — a caller can push an unbounded body into R2, exhausting storage/billing.`,
19
- metadata: { exportName: row.exportName, file: row.file, line: row.line, method: row.method }
20
- })
21
- );
22
- },
23
- source: "static",
24
- title: "Storage upload with no size cap"
25
- };
26
-
27
- export { storageUploadWithoutMaxSize as default };
@@ -1,34 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const tableWithoutInsert = {
4
- categories: ["SCHEMA"],
5
- description: 'No function inserts into this table via `ctx.db.insert("<table>", …)`. It may be read-only by design (seeded by a migration, replicated, or written through a path the advisor can\'t see) — or it may be dead schema.',
6
- facing: "INTERNAL",
7
- level: "INFO",
8
- name: "table_without_insert",
9
- remediation: 'If the table should be writable, add a mutation that calls `ctx.db.insert("<table>", …)`. If it is read-only or seeded elsewhere, this advisory can be ignored.',
10
- run: (context) => {
11
- if (context.inserts === void 0) {
12
- return [];
13
- }
14
- const insertedTables = new Set(context.inserts.filter((write) => write.table !== "").map((write) => write.table));
15
- const findings = [];
16
- for (const table of context.schema.tables) {
17
- if (insertedTables.has(table.name) || table.externallyManaged === true) {
18
- continue;
19
- }
20
- findings.push(
21
- emit(tableWithoutInsert, {
22
- cacheKey: `table_without_insert:${table.name}`,
23
- detail: `No function calls \`ctx.db.insert("${table.name}", …)\` — table "${table.name}" has no discovered insert path.`,
24
- metadata: { table: table.name }
25
- })
26
- );
27
- }
28
- return findings;
29
- },
30
- source: "static",
31
- title: "Table has no insert path"
32
- };
33
-
34
- export { tableWithoutInsert as default };
@@ -1,36 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const TIME_KINDS = /* @__PURE__ */ new Set(["date", "number", "timestamp"]);
4
- const ttlFieldNotTimestamp = {
5
- categories: ["SCHEMA"],
6
- description: "A `.ttl(field)` policy points at a column that is not an epoch-millisecond timestamp, so the alarm sweep's `field < now` comparison can't decide expiry correctly.",
7
- facing: "INTERNAL",
8
- level: "ERROR",
9
- name: "ttl_field_not_timestamp",
10
- remediation: "Point `.ttl(field)` at a `v.timestamp()` / `v.date()` / `v.number()` (epoch-ms) column, or add such a column.",
11
- run: (context) => {
12
- const findings = [];
13
- for (const table of context.schema.tables) {
14
- const { ttl } = table;
15
- if (!ttl) {
16
- continue;
17
- }
18
- const kind = table.columnKinds?.[ttl.field];
19
- if (kind === void 0 || TIME_KINDS.has(kind)) {
20
- continue;
21
- }
22
- findings.push(
23
- emit(ttlFieldNotTimestamp, {
24
- cacheKey: `ttl_field_not_timestamp:${table.name}:${ttl.field}`,
25
- detail: `Table "${table.name}" declares \`.ttl("${ttl.field}")\`, but "${ttl.field}" is a ${kind} column, not an epoch-millisecond timestamp.`,
26
- metadata: { field: ttl.field, kind, table: table.name }
27
- })
28
- );
29
- }
30
- return findings;
31
- },
32
- source: "static",
33
- title: "TTL field is not a timestamp"
34
- };
35
-
36
- export { ttlFieldNotTimestamp as default };
@@ -1,32 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const unboundedStringArgument = {
4
- categories: ["SECURITY"],
5
- description: "A public `v.string()` argument has no maximum-length bound. An unbounded string lets a client submit arbitrarily large input — abusing storage and CPU on every request that processes it.",
6
- facing: "EXTERNAL",
7
- level: "INFO",
8
- name: "unbounded_string_arg",
9
- remediation: "Add a max-length bound via `.check(...)` / `.meta({ maxLength })` on the string validator (e.g. cap a name at 256, a body at a few KB). Size the cap to the field's real-world maximum.",
10
- run: (context) => {
11
- if (context.argValidators === void 0) {
12
- return [];
13
- }
14
- const findings = [];
15
- for (const procedure of context.argValidators) {
16
- for (const argument of procedure.unboundedStringArgs) {
17
- findings.push(
18
- emit(unboundedStringArgument, {
19
- cacheKey: `unbounded_string_arg:${procedure.file}:${procedure.exportName}:${argument}`,
20
- detail: `Arg \`${argument}\` of public procedure \`${procedure.exportName}\` (${procedure.file}:${procedure.line.toString()}) is an unbounded \`v.string()\`. Add a max-length bound to cap payload size.`,
21
- metadata: { argument, exportName: procedure.exportName, file: procedure.file, line: procedure.line }
22
- })
23
- );
24
- }
25
- }
26
- return findings;
27
- },
28
- source: "static",
29
- title: "Public string argument has no length bound"
30
- };
31
-
32
- export { unboundedStringArgument as default };
@@ -1,45 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
- import { l as leadingIndexedColumns, P as PRIMARY_KEY, s as suggestIndexName } from './fk-index-IUK1ukgs.mjs';
3
-
4
- const unindexedForeignKey = {
5
- categories: ["PERFORMANCE"],
6
- description: "A foreign-key column declared by a `one` relation has no index leading with it. Reads that filter or join on the column full-scan the table, which gets linearly slower as rows accumulate.",
7
- facing: "EXTERNAL",
8
- level: "INFO",
9
- name: "unindexed_foreign_key",
10
- remediation: 'Add a secondary index leading with the FK column, e.g. `.index("byAuthorId", ["authorId"])`.',
11
- run: (context) => {
12
- const findings = [];
13
- for (const table of context.schema.tables) {
14
- const indexed = leadingIndexedColumns(table);
15
- for (const relation of table.relations) {
16
- if (relation.kind !== "one") {
17
- continue;
18
- }
19
- const fkColumn = relation.field;
20
- if (fkColumn === PRIMARY_KEY || indexed.has(fkColumn)) {
21
- continue;
22
- }
23
- const suggestedIndex = suggestIndexName(fkColumn);
24
- findings.push(
25
- emit(unindexedForeignKey, {
26
- cacheKey: `unindexed_foreign_key:${table.name}:${fkColumn}`,
27
- detail: `Relation "${relation.name}" on table "${table.name}" references "${relation.table}" via column "${fkColumn}", which is not the leading column of any index. Reads filtering or joining on "${fkColumn}" full-scan "${table.name}".`,
28
- metadata: {
29
- fkColumn,
30
- references: { column: relation.references, table: relation.table },
31
- relation: relation.name,
32
- suggestedIndex: { fields: [fkColumn], name: suggestedIndex },
33
- table: table.name
34
- }
35
- })
36
- );
37
- }
38
- }
39
- return findings;
40
- },
41
- source: "static",
42
- title: "Unindexed foreign key"
43
- };
44
-
45
- export { unindexedForeignKey as default };
@@ -1,53 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
- import { P as PRIMARY_KEY, l as leadingIndexedColumns, s as suggestIndexName } from './fk-index-IUK1ukgs.mjs';
3
-
4
- const unindexedRelationTarget = {
5
- categories: ["PERFORMANCE"],
6
- description: "A `many` relation's foreign-key column on the target table has no index leading with it. Relation predicates (`some`/`none`/`every`) and `with:` child reads filter the target on that column, full-scanning it as rows accumulate.",
7
- facing: "EXTERNAL",
8
- level: "INFO",
9
- name: "unindexed_relation_target",
10
- remediation: 'Add a secondary index on the target table leading with the FK column, e.g. `.index("byAuthorId", ["authorId"])`.',
11
- run: (context) => {
12
- const findings = [];
13
- const tablesByName = new Map(context.schema.tables.map((table) => [table.name, table]));
14
- for (const table of context.schema.tables) {
15
- for (const relation of table.relations) {
16
- if (relation.kind !== "many") {
17
- continue;
18
- }
19
- const target = tablesByName.get(relation.table);
20
- if (target === void 0) {
21
- continue;
22
- }
23
- const fkColumn = relation.field;
24
- if (fkColumn === PRIMARY_KEY) {
25
- continue;
26
- }
27
- const coveredByForeignKeyLint = target.relations.some((targetRelation) => targetRelation.kind === "one" && targetRelation.field === fkColumn);
28
- if (coveredByForeignKeyLint || leadingIndexedColumns(target).has(fkColumn)) {
29
- continue;
30
- }
31
- const suggestedIndex = suggestIndexName(fkColumn);
32
- findings.push(
33
- emit(unindexedRelationTarget, {
34
- cacheKey: `unindexed_relation_target:${relation.table}:${fkColumn}`,
35
- detail: `Relation "${relation.name}" on table "${table.name}" is a to-many over "${relation.table}" via its column "${fkColumn}", which is not the leading column of any index on "${relation.table}". Relation predicates (\`some\`/\`none\`/\`every\`) and \`with:\` reads of "${relation.name}" full-scan "${relation.table}".`,
36
- metadata: {
37
- fkColumn,
38
- references: { column: relation.references, table: table.name },
39
- relation: relation.name,
40
- suggestedIndex: { fields: [fkColumn], name: suggestedIndex },
41
- table: relation.table
42
- }
43
- })
44
- );
45
- }
46
- }
47
- return findings;
48
- },
49
- source: "static",
50
- title: "Unindexed relation target"
51
- };
52
-
53
- export { unindexedRelationTarget as default };
@@ -1,42 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
- import { i as isPublicWrite } from './helpers-BySnKhVB.mjs';
3
-
4
- const userCreatingMutationWithoutCaptcha = {
5
- categories: ["SECURITY"],
6
- description: "A public `mutation`/`action` that creates a user/session or sends mail has no CAPTCHA / bot check. Account-creating and mail-sending endpoints are prime automated-abuse targets (credential stuffing, mailbox flooding, disposable-account farming).",
7
- facing: "EXTERNAL",
8
- level: "WARN",
9
- name: "user_creating_mutation_without_captcha",
10
- remediation: "Add a server-verified human check: `.use(verifyTurnstile({ secret, token }))` from `@lunora/auth`, or wrap it with `.use(protectPublic({ rateLimit, captcha }))` from `@lunora/server`. Pair with a rate limit for defense in depth.",
11
- run: (context) => {
12
- if (context.procedureProtections === void 0) {
13
- return [];
14
- }
15
- const findings = [];
16
- for (const procedure of context.procedureProtections) {
17
- const sensitive = procedure.writesUserTable || procedure.callsMail;
18
- if (!isPublicWrite(procedure) || !sensitive || procedure.usesCaptcha) {
19
- continue;
20
- }
21
- const reason = procedure.writesUserTable ? "writes a user/session table" : "sends mail";
22
- findings.push(
23
- emit(userCreatingMutationWithoutCaptcha, {
24
- cacheKey: `user_creating_mutation_without_captcha:${procedure.file}:${procedure.exportName}`,
25
- detail: `Public ${procedure.kind} \`${procedure.exportName}\` (${procedure.file}) ${reason} but has no CAPTCHA check. Add \`.use(verifyTurnstile(...))\` or \`.use(protectPublic({ captcha }))\`.`,
26
- metadata: {
27
- callsMail: procedure.callsMail,
28
- exportName: procedure.exportName,
29
- file: procedure.file,
30
- kind: procedure.kind,
31
- writesUserTable: procedure.writesUserTable
32
- }
33
- })
34
- );
35
- }
36
- return findings;
37
- },
38
- source: "static",
39
- title: "Account-creating / mail-sending write without a CAPTCHA"
40
- };
41
-
42
- export { userCreatingMutationWithoutCaptcha as default };
@@ -1,19 +0,0 @@
1
- import { m as makeArgumentDerivedSinkLint } from './argument-derived-sink-C1xTTqAt.mjs';
2
-
3
- const vectorsNamespaceFromUserInput = makeArgumentDerivedSinkLint({
4
- cacheKey: (access) => `vectors_namespace_from_user_input:${access.file}:${access.line.toString()}`,
5
- categories: ["SECURITY"],
6
- description: "A `ctx.vectors.query`/`upsert`/`upsertMany` call uses a `namespace` derived from the handler's `args` with no server-side scoping. A Vectorize namespace partitions one index into isolated sub-collections, so an unscoped namespace lets any caller read or poison another tenant's vectors.",
7
- detail: (access) => `\`ctx.vectors.${access.method}\` in \`${access.exportName}\` (${access.file}:${access.line.toString()}) uses a Vectorize namespace derived from \`args\` with no server-side scoping — any caller can read or poison another tenant's vectors. Derive the namespace from a server-trusted identity (e.g. \`\${ctx.auth.orgId}\`), never from \`args\`.`,
8
- facing: "EXTERNAL",
9
- getAccesses: (context) => context.vectorNamespaceAccesses,
10
- level: "WARN",
11
- metadata: (access) => {
12
- return { exportName: access.exportName, file: access.file, line: access.line, method: access.method };
13
- },
14
- name: "vectors_namespace_from_user_input",
15
- remediation: `Derive the \`namespace\` from a server-trusted identity (e.g. \`\${ctx.auth.orgId}\`), never from \`args\`.`,
16
- title: "Vectorize namespace derived from unscoped user input"
17
- });
18
-
19
- export { vectorsNamespaceFromUserInput as default };
@@ -1,48 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const workflowDuplicateStepName = {
4
- categories: ["SCHEMA"],
5
- description: "Two durable steps in this workflow share a name. Cloudflare memoizes a step by its name, so on replay the second call returns the first step's cached result instead of running its body — silently skipping the work without an error.",
6
- facing: "INTERNAL",
7
- level: "ERROR",
8
- // eslint-disable-next-line no-secrets/no-secrets -- the lint's rule id, not a credential
9
- name: "workflow_duplicate_step_name",
10
- remediation: "Give every `step.do` / `step.sleep` / `step.sleepUntil` / `step.waitForEvent` call in the workflow a unique name. If a step legitimately repeats (e.g. a loop), make the name distinct per iteration by interpolating the item id into the step name.",
11
- run: (context) => {
12
- if (context.workflows === void 0) {
13
- return [];
14
- }
15
- const findings = [];
16
- for (const workflow of context.workflows) {
17
- const { steps } = workflow;
18
- if (steps === void 0 || steps.length === 0) {
19
- continue;
20
- }
21
- const firstLineByName = /* @__PURE__ */ new Map();
22
- const reported = /* @__PURE__ */ new Set();
23
- for (const step of steps) {
24
- const firstLine = firstLineByName.get(step.name);
25
- if (firstLine === void 0) {
26
- firstLineByName.set(step.name, step.line);
27
- continue;
28
- }
29
- if (reported.has(step.name)) {
30
- continue;
31
- }
32
- reported.add(step.name);
33
- findings.push(
34
- emit(workflowDuplicateStepName, {
35
- cacheKey: `workflow_duplicate_step_name:${workflow.exportName}:${step.name}`,
36
- detail: `Workflow "${workflow.exportName}" reuses the durable step name "${step.name}" (first at line ${String(firstLine)}, again at line ${String(step.line)}). The second call returns the first's cached result instead of running.`,
37
- metadata: { firstLine, line: step.line, stepName: step.name, workflow: workflow.exportName }
38
- })
39
- );
40
- }
41
- }
42
- return findings;
43
- },
44
- source: "static",
45
- title: "Duplicate durable step name in workflow"
46
- };
47
-
48
- export { workflowDuplicateStepName as default };
@@ -1,34 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const workflowUnknownTarget = {
4
- categories: ["SCHEMA"],
5
- description: 'A `ctx.workflows.get("<name>")` call references a workflow that is not declared by any `defineWorkflow` export in `lunora/workflows.ts`. The name is a typo or points at a removed/renamed workflow — the call throws at runtime.',
6
- facing: "INTERNAL",
7
- level: "ERROR",
8
- name: "workflow_unknown_target",
9
- remediation: 'Fix the workflow name in the `ctx.workflows.get("…")` call, or add the missing `defineWorkflow` export to `lunora/workflows.ts`.',
10
- run: (context) => {
11
- if (context.workflows === void 0 || context.workflowCalls === void 0) {
12
- return [];
13
- }
14
- const declared = new Set(context.workflows.map((workflow) => workflow.exportName));
15
- const findings = [];
16
- for (const call of context.workflowCalls) {
17
- if (call.workflow === "" || declared.has(call.workflow)) {
18
- continue;
19
- }
20
- findings.push(
21
- emit(workflowUnknownTarget, {
22
- cacheKey: `workflow_unknown_target:${call.file}:${call.exportName}:${call.workflow}`,
23
- detail: `\`ctx.workflows.get("${call.workflow}")\` in "${call.exportName}" (${call.file}) references workflow "${call.workflow}", which is not declared in lunora/workflows.ts.`,
24
- metadata: { exportName: call.exportName, file: call.file, line: call.line, workflow: call.workflow }
25
- })
26
- );
27
- }
28
- return findings;
29
- },
30
- source: "static",
31
- title: "Workflow call references unknown workflow"
32
- };
33
-
34
- export { workflowUnknownTarget as default };
@@ -1,38 +0,0 @@
1
- import { e as emit } from './finding-Dm_zvzS1.mjs';
2
-
3
- const workflowUnused = {
4
- categories: ["SCHEMA"],
5
- description: 'No function starts this workflow via `ctx.workflows.get("<name>")`. It may be triggered through a path the advisor can\'t see (the Cloudflare API, a wrangler invocation, a cross-service binding) — or it may be dead code that still deploys as a billable WorkflowEntrypoint.',
6
- facing: "INTERNAL",
7
- level: "INFO",
8
- name: "workflow_unused",
9
- remediation: 'If the workflow should be triggered in-app, start it from a mutation/action with `ctx.workflows.get("<name>").create({ params })`. If it is started externally or is no longer needed, this advisory can be ignored (or remove the `defineWorkflow` export).',
10
- run: (context) => {
11
- if (context.workflows === void 0) {
12
- return [];
13
- }
14
- const calls = context.workflowCalls ?? [];
15
- if (calls.some((call) => call.workflow === "")) {
16
- return [];
17
- }
18
- const started = new Set(calls.map((call) => call.workflow));
19
- const findings = [];
20
- for (const workflow of context.workflows) {
21
- if (started.has(workflow.exportName)) {
22
- continue;
23
- }
24
- findings.push(
25
- emit(workflowUnused, {
26
- cacheKey: `workflow_unused:${workflow.exportName}`,
27
- detail: `No function calls \`ctx.workflows.get("${workflow.exportName}")\` — workflow "${workflow.exportName}" is declared but never started in app code.`,
28
- metadata: { workflow: workflow.exportName }
29
- })
30
- );
31
- }
32
- return findings;
33
- },
34
- source: "static",
35
- title: "Workflow is never started"
36
- };
37
-
38
- export { workflowUnused as default };