@contrast/agent 4.15.0 → 4.16.1

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 (310) hide show
  1. package/README.md +1 -1
  2. package/lib/assess/sinks/dynamo.js +87 -76
  3. package/lib/libraries.js +1 -1
  4. package/lib/protect/errors/handler-async-errors.js +1 -1
  5. package/lib/protect/service.js +11 -14
  6. package/lib/reporter/models/app-update/library.js +60 -6
  7. package/node_modules/moment/CHANGELOG.md +6 -0
  8. package/node_modules/moment/dist/locale/ar-kw.js +4 -3
  9. package/node_modules/moment/dist/locale/ar-ly.js +1 -1
  10. package/node_modules/moment/dist/locale/ar-ma.js +4 -3
  11. package/node_modules/moment/dist/locale/ar-sa.js +4 -3
  12. package/node_modules/moment/dist/locale/ar-tn.js +4 -3
  13. package/node_modules/moment/dist/locale/az.js +4 -3
  14. package/node_modules/moment/dist/locale/be.js +10 -9
  15. package/node_modules/moment/dist/locale/bn-bd.js +4 -3
  16. package/node_modules/moment/dist/locale/bn.js +4 -3
  17. package/node_modules/moment/dist/locale/bo.js +8 -6
  18. package/node_modules/moment/dist/locale/br.js +6 -3
  19. package/node_modules/moment/dist/locale/bs.js +4 -3
  20. package/node_modules/moment/dist/locale/ca.js +12 -9
  21. package/node_modules/moment/dist/locale/cs.js +15 -6
  22. package/node_modules/moment/dist/locale/cv.js +4 -3
  23. package/node_modules/moment/dist/locale/cy.js +4 -3
  24. package/node_modules/moment/dist/locale/de-at.js +6 -6
  25. package/node_modules/moment/dist/locale/de-ch.js +6 -6
  26. package/node_modules/moment/dist/locale/de.js +6 -6
  27. package/node_modules/moment/dist/locale/el.js +8 -6
  28. package/node_modules/moment/dist/locale/es-do.js +10 -6
  29. package/node_modules/moment/dist/locale/es-mx.js +10 -6
  30. package/node_modules/moment/dist/locale/es-us.js +10 -6
  31. package/node_modules/moment/dist/locale/es.js +10 -6
  32. package/node_modules/moment/dist/locale/et.js +6 -6
  33. package/node_modules/moment/dist/locale/eu.js +8 -6
  34. package/node_modules/moment/dist/locale/fa.js +12 -9
  35. package/node_modules/moment/dist/locale/fi.js +12 -9
  36. package/node_modules/moment/dist/locale/fo.js +4 -3
  37. package/node_modules/moment/dist/locale/fr-ca.js +4 -3
  38. package/node_modules/moment/dist/locale/fr-ch.js +4 -3
  39. package/node_modules/moment/dist/locale/fr.js +10 -6
  40. package/node_modules/moment/dist/locale/fy.js +4 -6
  41. package/node_modules/moment/dist/locale/gl.js +4 -3
  42. package/node_modules/moment/dist/locale/gom-deva.js +8 -6
  43. package/node_modules/moment/dist/locale/gom-latn.js +6 -6
  44. package/node_modules/moment/dist/locale/gu.js +4 -3
  45. package/node_modules/moment/dist/locale/he.js +4 -4
  46. package/node_modules/moment/dist/locale/hi.js +14 -10
  47. package/node_modules/moment/dist/locale/hr.js +7 -5
  48. package/node_modules/moment/dist/locale/hu.js +6 -6
  49. package/node_modules/moment/dist/locale/hy-am.js +8 -6
  50. package/node_modules/moment/dist/locale/is.js +4 -3
  51. package/node_modules/moment/dist/locale/ka.js +10 -10
  52. package/node_modules/moment/dist/locale/km.js +4 -3
  53. package/node_modules/moment/dist/locale/kn.js +4 -3
  54. package/node_modules/moment/dist/locale/ku.js +6 -6
  55. package/node_modules/moment/dist/locale/lb.js +8 -6
  56. package/node_modules/moment/dist/locale/lo.js +4 -3
  57. package/node_modules/moment/dist/locale/lt.js +8 -6
  58. package/node_modules/moment/dist/locale/lv.js +4 -3
  59. package/node_modules/moment/dist/locale/me.js +2 -3
  60. package/node_modules/moment/dist/locale/mi.js +4 -3
  61. package/node_modules/moment/dist/locale/ml.js +8 -6
  62. package/node_modules/moment/dist/locale/mn.js +4 -3
  63. package/node_modules/moment/dist/locale/mr.js +4 -3
  64. package/node_modules/moment/dist/locale/mt.js +4 -3
  65. package/node_modules/moment/dist/locale/nb.js +2 -3
  66. package/node_modules/moment/dist/locale/ne.js +4 -3
  67. package/node_modules/moment/dist/locale/nl-be.js +12 -12
  68. package/node_modules/moment/dist/locale/nl.js +12 -12
  69. package/node_modules/moment/dist/locale/nn.js +2 -3
  70. package/node_modules/moment/dist/locale/oc-lnc.js +8 -6
  71. package/node_modules/moment/dist/locale/pa-in.js +4 -3
  72. package/node_modules/moment/dist/locale/pl.js +10 -9
  73. package/node_modules/moment/dist/locale/pt-br.js +4 -3
  74. package/node_modules/moment/dist/locale/pt.js +4 -3
  75. package/node_modules/moment/dist/locale/ro.js +4 -3
  76. package/node_modules/moment/dist/locale/ru.js +20 -13
  77. package/node_modules/moment/dist/locale/se.js +6 -6
  78. package/node_modules/moment/dist/locale/si.js +4 -3
  79. package/node_modules/moment/dist/locale/sk.js +4 -3
  80. package/node_modules/moment/dist/locale/sl.js +4 -3
  81. package/node_modules/moment/dist/locale/sr-cyrl.js +32 -22
  82. package/node_modules/moment/dist/locale/sr.js +32 -22
  83. package/node_modules/moment/dist/locale/ss.js +4 -3
  84. package/node_modules/moment/dist/locale/sw.js +4 -3
  85. package/node_modules/moment/dist/locale/ta.js +8 -6
  86. package/node_modules/moment/dist/locale/te.js +8 -6
  87. package/node_modules/moment/dist/locale/tg.js +4 -3
  88. package/node_modules/moment/dist/locale/th.js +4 -3
  89. package/node_modules/moment/dist/locale/tlh.js +8 -9
  90. package/node_modules/moment/dist/locale/tr.js +1 -1
  91. package/node_modules/moment/dist/locale/tzm-latn.js +4 -3
  92. package/node_modules/moment/dist/locale/tzm.js +4 -3
  93. package/node_modules/moment/dist/locale/ug-cn.js +4 -3
  94. package/node_modules/moment/dist/locale/uk.js +16 -12
  95. package/node_modules/moment/dist/locale/uz-latn.js +4 -3
  96. package/node_modules/moment/dist/locale/vi.js +4 -3
  97. package/node_modules/moment/dist/locale/x-pseudo.js +8 -6
  98. package/node_modules/moment/dist/moment.js +95 -80
  99. package/node_modules/moment/locale/ar-kw.js +4 -3
  100. package/node_modules/moment/locale/ar-ly.js +1 -1
  101. package/node_modules/moment/locale/ar-ma.js +4 -3
  102. package/node_modules/moment/locale/ar-sa.js +4 -3
  103. package/node_modules/moment/locale/ar-tn.js +4 -3
  104. package/node_modules/moment/locale/az.js +4 -3
  105. package/node_modules/moment/locale/be.js +10 -9
  106. package/node_modules/moment/locale/bn-bd.js +4 -3
  107. package/node_modules/moment/locale/bn.js +4 -3
  108. package/node_modules/moment/locale/bo.js +8 -6
  109. package/node_modules/moment/locale/br.js +6 -3
  110. package/node_modules/moment/locale/bs.js +4 -3
  111. package/node_modules/moment/locale/ca.js +12 -9
  112. package/node_modules/moment/locale/cs.js +15 -6
  113. package/node_modules/moment/locale/cv.js +4 -3
  114. package/node_modules/moment/locale/cy.js +4 -3
  115. package/node_modules/moment/locale/de-at.js +6 -6
  116. package/node_modules/moment/locale/de-ch.js +6 -6
  117. package/node_modules/moment/locale/de.js +6 -6
  118. package/node_modules/moment/locale/el.js +8 -6
  119. package/node_modules/moment/locale/es-do.js +10 -6
  120. package/node_modules/moment/locale/es-mx.js +10 -6
  121. package/node_modules/moment/locale/es-us.js +10 -6
  122. package/node_modules/moment/locale/es.js +10 -6
  123. package/node_modules/moment/locale/et.js +6 -6
  124. package/node_modules/moment/locale/eu.js +8 -6
  125. package/node_modules/moment/locale/fa.js +12 -9
  126. package/node_modules/moment/locale/fi.js +12 -9
  127. package/node_modules/moment/locale/fo.js +4 -3
  128. package/node_modules/moment/locale/fr-ca.js +4 -3
  129. package/node_modules/moment/locale/fr-ch.js +4 -3
  130. package/node_modules/moment/locale/fr.js +10 -6
  131. package/node_modules/moment/locale/fy.js +4 -6
  132. package/node_modules/moment/locale/gl.js +4 -3
  133. package/node_modules/moment/locale/gom-deva.js +8 -6
  134. package/node_modules/moment/locale/gom-latn.js +6 -6
  135. package/node_modules/moment/locale/gu.js +4 -3
  136. package/node_modules/moment/locale/he.js +4 -4
  137. package/node_modules/moment/locale/hi.js +14 -10
  138. package/node_modules/moment/locale/hr.js +7 -5
  139. package/node_modules/moment/locale/hu.js +6 -6
  140. package/node_modules/moment/locale/hy-am.js +8 -6
  141. package/node_modules/moment/locale/is.js +4 -3
  142. package/node_modules/moment/locale/ka.js +10 -10
  143. package/node_modules/moment/locale/km.js +4 -3
  144. package/node_modules/moment/locale/kn.js +4 -3
  145. package/node_modules/moment/locale/ku.js +6 -6
  146. package/node_modules/moment/locale/lb.js +8 -6
  147. package/node_modules/moment/locale/lo.js +4 -3
  148. package/node_modules/moment/locale/lt.js +8 -6
  149. package/node_modules/moment/locale/lv.js +4 -3
  150. package/node_modules/moment/locale/me.js +2 -3
  151. package/node_modules/moment/locale/mi.js +4 -3
  152. package/node_modules/moment/locale/ml.js +8 -6
  153. package/node_modules/moment/locale/mn.js +4 -3
  154. package/node_modules/moment/locale/mr.js +4 -3
  155. package/node_modules/moment/locale/mt.js +4 -3
  156. package/node_modules/moment/locale/nb.js +2 -3
  157. package/node_modules/moment/locale/ne.js +4 -3
  158. package/node_modules/moment/locale/nl-be.js +12 -12
  159. package/node_modules/moment/locale/nl.js +12 -12
  160. package/node_modules/moment/locale/nn.js +2 -3
  161. package/node_modules/moment/locale/oc-lnc.js +8 -6
  162. package/node_modules/moment/locale/pa-in.js +4 -3
  163. package/node_modules/moment/locale/pl.js +10 -9
  164. package/node_modules/moment/locale/pt-br.js +4 -3
  165. package/node_modules/moment/locale/pt.js +4 -3
  166. package/node_modules/moment/locale/ro.js +4 -3
  167. package/node_modules/moment/locale/ru.js +20 -13
  168. package/node_modules/moment/locale/se.js +6 -6
  169. package/node_modules/moment/locale/si.js +4 -3
  170. package/node_modules/moment/locale/sk.js +4 -3
  171. package/node_modules/moment/locale/sl.js +4 -3
  172. package/node_modules/moment/locale/sr-cyrl.js +32 -22
  173. package/node_modules/moment/locale/sr.js +32 -22
  174. package/node_modules/moment/locale/ss.js +4 -3
  175. package/node_modules/moment/locale/sw.js +4 -3
  176. package/node_modules/moment/locale/ta.js +8 -6
  177. package/node_modules/moment/locale/te.js +8 -6
  178. package/node_modules/moment/locale/tg.js +4 -3
  179. package/node_modules/moment/locale/th.js +4 -3
  180. package/node_modules/moment/locale/tlh.js +8 -9
  181. package/node_modules/moment/locale/tr.js +1 -1
  182. package/node_modules/moment/locale/tzm-latn.js +4 -3
  183. package/node_modules/moment/locale/tzm.js +4 -3
  184. package/node_modules/moment/locale/ug-cn.js +4 -3
  185. package/node_modules/moment/locale/uk.js +16 -12
  186. package/node_modules/moment/locale/uz-latn.js +4 -3
  187. package/node_modules/moment/locale/vi.js +4 -3
  188. package/node_modules/moment/locale/x-pseudo.js +8 -6
  189. package/node_modules/moment/min/locales.js +613 -474
  190. package/node_modules/moment/min/locales.min.js +1 -1
  191. package/node_modules/moment/min/locales.min.js.map +1 -1
  192. package/node_modules/moment/min/moment-with-locales.js +707 -553
  193. package/node_modules/moment/min/moment-with-locales.min.js +1 -1
  194. package/node_modules/moment/min/moment-with-locales.min.js.map +1 -1
  195. package/node_modules/moment/min/moment.min.js +1 -1
  196. package/node_modules/moment/min/moment.min.js.map +1 -1
  197. package/node_modules/moment/moment.js +95 -80
  198. package/node_modules/moment/package.json +4 -4
  199. package/node_modules/moment/src/lib/create/from-string-and-array.js +4 -3
  200. package/node_modules/moment/src/lib/create/from-string-and-format.js +4 -3
  201. package/node_modules/moment/src/lib/create/from-string.js +11 -7
  202. package/node_modules/moment/src/lib/duration/create.js +2 -1
  203. package/node_modules/moment/src/lib/duration/valid.js +3 -2
  204. package/node_modules/moment/src/lib/format/format.js +2 -1
  205. package/node_modules/moment/src/lib/locale/locales.js +7 -1
  206. package/node_modules/moment/src/lib/moment/constructor.js +6 -3
  207. package/node_modules/moment/src/lib/moment/get-set.js +3 -2
  208. package/node_modules/moment/src/lib/parse/regex.js +8 -10
  209. package/node_modules/moment/src/lib/parse/token.js +4 -2
  210. package/node_modules/moment/src/lib/units/day-of-week.js +2 -3
  211. package/node_modules/moment/src/lib/units/era.js +10 -12
  212. package/node_modules/moment/src/lib/units/month.js +6 -6
  213. package/node_modules/moment/src/lib/units/week-year.js +6 -8
  214. package/node_modules/moment/src/lib/units/week.js +6 -8
  215. package/node_modules/moment/src/lib/utils/deprecate.js +3 -2
  216. package/node_modules/moment/src/lib/utils/is-moment-input.js +3 -2
  217. package/node_modules/moment/src/lib/utils/map.js +3 -2
  218. package/node_modules/moment/src/locale/ar-kw.js +4 -3
  219. package/node_modules/moment/src/locale/ar-ly.js +1 -1
  220. package/node_modules/moment/src/locale/ar-ma.js +4 -3
  221. package/node_modules/moment/src/locale/ar-sa.js +4 -3
  222. package/node_modules/moment/src/locale/ar-tn.js +4 -3
  223. package/node_modules/moment/src/locale/az.js +4 -3
  224. package/node_modules/moment/src/locale/be.js +10 -9
  225. package/node_modules/moment/src/locale/bn-bd.js +4 -3
  226. package/node_modules/moment/src/locale/bn.js +4 -3
  227. package/node_modules/moment/src/locale/bo.js +8 -6
  228. package/node_modules/moment/src/locale/br.js +6 -3
  229. package/node_modules/moment/src/locale/bs.js +4 -3
  230. package/node_modules/moment/src/locale/ca.js +12 -9
  231. package/node_modules/moment/src/locale/cs.js +15 -6
  232. package/node_modules/moment/src/locale/cv.js +4 -3
  233. package/node_modules/moment/src/locale/cy.js +4 -3
  234. package/node_modules/moment/src/locale/de-at.js +6 -6
  235. package/node_modules/moment/src/locale/de-ch.js +6 -6
  236. package/node_modules/moment/src/locale/de.js +6 -6
  237. package/node_modules/moment/src/locale/el.js +8 -6
  238. package/node_modules/moment/src/locale/es-do.js +10 -6
  239. package/node_modules/moment/src/locale/es-mx.js +10 -6
  240. package/node_modules/moment/src/locale/es-us.js +10 -6
  241. package/node_modules/moment/src/locale/es.js +10 -6
  242. package/node_modules/moment/src/locale/et.js +6 -6
  243. package/node_modules/moment/src/locale/eu.js +8 -6
  244. package/node_modules/moment/src/locale/fa.js +12 -9
  245. package/node_modules/moment/src/locale/fi.js +12 -9
  246. package/node_modules/moment/src/locale/fo.js +4 -3
  247. package/node_modules/moment/src/locale/fr-ca.js +4 -3
  248. package/node_modules/moment/src/locale/fr-ch.js +4 -3
  249. package/node_modules/moment/src/locale/fr.js +10 -6
  250. package/node_modules/moment/src/locale/fy.js +4 -6
  251. package/node_modules/moment/src/locale/gl.js +4 -3
  252. package/node_modules/moment/src/locale/gom-deva.js +8 -6
  253. package/node_modules/moment/src/locale/gom-latn.js +6 -6
  254. package/node_modules/moment/src/locale/gu.js +4 -3
  255. package/node_modules/moment/src/locale/he.js +4 -4
  256. package/node_modules/moment/src/locale/hi.js +14 -10
  257. package/node_modules/moment/src/locale/hr.js +7 -5
  258. package/node_modules/moment/src/locale/hu.js +6 -6
  259. package/node_modules/moment/src/locale/hy-am.js +8 -6
  260. package/node_modules/moment/src/locale/is.js +4 -3
  261. package/node_modules/moment/src/locale/ka.js +10 -10
  262. package/node_modules/moment/src/locale/km.js +4 -3
  263. package/node_modules/moment/src/locale/kn.js +4 -3
  264. package/node_modules/moment/src/locale/ku.js +6 -6
  265. package/node_modules/moment/src/locale/lb.js +8 -6
  266. package/node_modules/moment/src/locale/lo.js +4 -3
  267. package/node_modules/moment/src/locale/lt.js +8 -6
  268. package/node_modules/moment/src/locale/lv.js +4 -3
  269. package/node_modules/moment/src/locale/me.js +2 -3
  270. package/node_modules/moment/src/locale/mi.js +4 -3
  271. package/node_modules/moment/src/locale/ml.js +8 -6
  272. package/node_modules/moment/src/locale/mn.js +4 -3
  273. package/node_modules/moment/src/locale/mr.js +4 -3
  274. package/node_modules/moment/src/locale/mt.js +4 -3
  275. package/node_modules/moment/src/locale/nb.js +2 -3
  276. package/node_modules/moment/src/locale/ne.js +4 -3
  277. package/node_modules/moment/src/locale/nl-be.js +12 -12
  278. package/node_modules/moment/src/locale/nl.js +12 -12
  279. package/node_modules/moment/src/locale/nn.js +2 -3
  280. package/node_modules/moment/src/locale/oc-lnc.js +8 -6
  281. package/node_modules/moment/src/locale/pa-in.js +4 -3
  282. package/node_modules/moment/src/locale/pl.js +10 -9
  283. package/node_modules/moment/src/locale/pt-br.js +4 -3
  284. package/node_modules/moment/src/locale/pt.js +4 -3
  285. package/node_modules/moment/src/locale/ro.js +4 -3
  286. package/node_modules/moment/src/locale/ru.js +20 -13
  287. package/node_modules/moment/src/locale/se.js +6 -6
  288. package/node_modules/moment/src/locale/si.js +4 -3
  289. package/node_modules/moment/src/locale/sk.js +4 -3
  290. package/node_modules/moment/src/locale/sl.js +4 -3
  291. package/node_modules/moment/src/locale/sr-cyrl.js +32 -22
  292. package/node_modules/moment/src/locale/sr.js +32 -22
  293. package/node_modules/moment/src/locale/ss.js +4 -3
  294. package/node_modules/moment/src/locale/sw.js +4 -3
  295. package/node_modules/moment/src/locale/ta.js +8 -6
  296. package/node_modules/moment/src/locale/te.js +8 -6
  297. package/node_modules/moment/src/locale/tg.js +4 -3
  298. package/node_modules/moment/src/locale/th.js +4 -3
  299. package/node_modules/moment/src/locale/tlh.js +8 -9
  300. package/node_modules/moment/src/locale/tr.js +1 -1
  301. package/node_modules/moment/src/locale/tzm-latn.js +4 -3
  302. package/node_modules/moment/src/locale/tzm.js +4 -3
  303. package/node_modules/moment/src/locale/ug-cn.js +4 -3
  304. package/node_modules/moment/src/locale/uk.js +16 -12
  305. package/node_modules/moment/src/locale/uz-latn.js +4 -3
  306. package/node_modules/moment/src/locale/vi.js +4 -3
  307. package/node_modules/moment/src/locale/x-pseudo.js +8 -6
  308. package/node_modules/moment/src/moment.js +2 -2
  309. package/node_modules/moment/ts3.1-typings/moment.d.ts +1 -1
  310. package/package.json +3 -4
package/README.md CHANGED
@@ -108,4 +108,4 @@ api:
108
108
  | api.service_key | Contrast user account service key |
109
109
  | api.url | Address of the Contrast installation you would like your agent to report to |
110
110
 
111
- For detailed installation and configuration instructions, see the [Node.js Agent documentation](https://docs.contrastsecurity.com/installation-nodeconfig.html).
111
+ For detailed installation and configuration instructions, see the [Node.js Agent documentation](https://docs.contrastsecurity.com/en/install-node-js.html).
@@ -26,34 +26,38 @@ const disallowedTags = [
26
26
  'string-type-checked',
27
27
  ];
28
28
  const requiredTags = ['untrusted'];
29
- const moduleName = 'aws-sdk';
30
- const moduleNameV3 = '@aws-sdk/client-dynamodb';
31
- const relevantKeys = {
32
- v2: ['ExpressionAttributeValues', 'ExclusiveStartKey', 'ScanFilter'],
33
- v3: [
34
- 'ComparisonOperator',
35
- 'FilterExpression',
36
- 'ProjectionExpression',
37
- 'ScanFilter',
38
- ],
39
- };
40
- const requests = new WeakSet();
41
29
 
42
- // map data types to methods for extracting
43
- // values
44
- const dataTypes = {
45
- S: 'value',
46
- N: 'value',
47
- B: 'value',
48
- SS: 'array',
49
- NS: 'array',
50
- BS: 'array',
51
- M: 'object',
52
- L: 'collection',
53
- NULL: 'value',
54
- BOOL: 'value',
30
+ /*
31
+ * Schema of attributes the Node Agent is looking for user-controlled data
32
+ * The only exception to the rule so far is the ScanFilter in ScanCommand.
33
+ * It has nested schema too. So far we are only reporting a NoSQL Injection
34
+ * if ComparisonOperator within the ScanFilter is user-controlled.
35
+ * ScanFilter is handled individually in extractValues function
36
+ * */
37
+ const trackSchemaCommands = {
38
+ 'scan': {
39
+ attributes: [
40
+ 'ExpressionAttributeValues',
41
+ 'ExclusiveStartKey',
42
+ 'ScanFilter'
43
+ ]
44
+ },
45
+ 'executeStatement': { attributes: ['Statement'] },
46
+ 'ScanCommand': {
47
+ attributes: [
48
+ 'ComparisonOperator',
49
+ 'FilterExpression',
50
+ 'ProjectionExpression',
51
+ 'ScanFilter',
52
+ ]
53
+ },
54
+ 'ExecuteStatementCommand': {
55
+ attributes: ['Statement']
56
+ }
55
57
  };
56
58
 
59
+ const requests = new WeakSet();
60
+
57
61
  /**
58
62
  * Extracts all values from either a dynamo document client or client
59
63
  *
@@ -62,44 +66,25 @@ const dataTypes = {
62
66
  * @param {string} version DynamoDB SDK version
63
67
  * @return {Array} all string values from payload
64
68
  */
65
- function extractValues(payload = {}, mode = null, version = 'v2') {
69
+ function extractValues(command, payload = {}) {
66
70
  return _.flatten(
67
- relevantKeys[version].map((key) => {
68
- if (payload[key] === undefined) return;
71
+ trackSchemaCommands[command].attributes.map((key) => {
72
+ if (payload[key] == undefined) return;
69
73
  if (typeof payload[key] === 'string') return payload[key];
74
+
75
+ // ScanFilter is an exception. It is almost safe for any nested attribute
76
+ if (key === 'ScanFilter') {
77
+ // collect the values from ComparisonOperator attributes ONLY
78
+ return getComparisonValues(payload[key]);
79
+ }
80
+
70
81
  const values = _.values(payload[key]);
71
- const extractionMethod =
72
- mode === 'client' ? findTypedValues.bind(this) : findValues.bind(this);
82
+ const extractionMethod = findValues.bind(this);
73
83
  return _.flattenDeep(extractionMethod(values));
74
84
  }),
75
85
  );
76
86
  }
77
87
 
78
- /**
79
- * Extracts all strings from a dynamo client payload
80
- * Note: Each key is typed so we need to properly extract keys based on AttributeValue types
81
- *
82
- * @param {Object} values for all keys in ExpressionAttributeValues, ExclusiveStartKey or ScanFilter
83
- * @return {Array} all values
84
- */
85
- function findTypedValues(values) {
86
- return _.map(values, (value) => {
87
- const [type] = Object.keys(value);
88
- switch (dataTypes[type]) {
89
- case 'value':
90
- return value[type];
91
- case 'array':
92
- return _.values(value[type]);
93
- case 'object': {
94
- const values = _.values(value[type]);
95
- return findTypedValues(values);
96
- }
97
- case 'collection':
98
- return findTypedValues(value[type]);
99
- }
100
- });
101
- }
102
-
103
88
  /**
104
89
  * We only track strings. some data types
105
90
  * can contain strings as keys or values but
@@ -139,6 +124,27 @@ function findValues(values) {
139
124
  });
140
125
  }
141
126
 
127
+ /**
128
+ * Check if key exists in ScanFilter bject and return the value if so
129
+ * Each element of ScanFilter is an object with predictable structure
130
+ * "Genre": {
131
+ * "AttributeValueList":[ {"S":"Rock"} ],
132
+ * "ComparisonOperator": "EQ"
133
+ * }
134
+ *
135
+ * @param {Object} values for all keys in a given payload
136
+ * @param {String} key name we are looking the value of
137
+ * @return {Any} if value is found for a given key
138
+ */
139
+ const getComparisonValues = (obj) => Object.keys(obj).map(field => {
140
+ if (typeof obj[field] === 'object' && Object.prototype.hasOwnProperty.call(
141
+ obj[field],
142
+ 'ComparisonOperator'
143
+ )) {
144
+ return obj[field].ComparisonOperator;
145
+ }
146
+ });
147
+
142
148
  module.exports = ({ common }) => {
143
149
  const { isVulnerable, report } = common;
144
150
 
@@ -147,11 +153,11 @@ module.exports = ({ common }) => {
147
153
  * Registers the hooks for client and document client scan
148
154
  */
149
155
  dynamoSink.handle = function () {
150
- moduleHook.resolve({ name: moduleName }, (aws) => {
156
+ moduleHook.resolve({ name: 'aws-sdk' }, (aws) => {
151
157
  const client = aws.DynamoDB.prototype;
152
158
 
153
159
  patcher.patch(client, 'makeRequest', {
154
- name: `${moduleName}.DynamoDB.prototype`,
160
+ name: 'aws-sdk.DynamoDB.prototype',
155
161
  patchType: PATCH_TYPES.ASSESS_SINK,
156
162
  alwaysRun: true,
157
163
  post(data) {
@@ -163,7 +169,8 @@ module.exports = ({ common }) => {
163
169
  if (!AsyncStorage.getContext()) {
164
170
  return;
165
171
  }
166
- if (data.args[0] === 'scan') {
172
+
173
+ if (Object.keys(trackSchemaCommands).includes(data.args[0]) && data.args[1]) {
167
174
  if (requests.has(data.args[1])) {
168
175
  return;
169
176
  }
@@ -176,10 +183,10 @@ module.exports = ({ common }) => {
176
183
  result: data.result,
177
184
  };
178
185
 
179
- const values = extractValues(data.args[1], 'client', 'v2');
186
+ const values = extractValues(data.args[0], data.args[1]);
180
187
  dynamoSink.check({
181
188
  values,
182
- methodName: 'DynamoDB.prototype.scan',
189
+ methodName: `DynamoDB.prototype.${data.args[0]}`,
183
190
  data: ctxtData,
184
191
  });
185
192
  }
@@ -198,7 +205,7 @@ module.exports = ({ common }) => {
198
205
  name: 'aws-sdk.DynamoDB.DocumentClient.prototype',
199
206
  patchType: PATCH_TYPES.ASSESS_SINK,
200
207
  pre(data) {
201
- if (data.args[0] === 'scan') {
208
+ if (data.args[0] === 'scan' && data.args[1]) {
202
209
  requests.add(data.args[1]);
203
210
  }
204
211
  },
@@ -208,7 +215,7 @@ module.exports = ({ common }) => {
208
215
  name: 'aws-sdk.DynamoDB.DocumentClient.prototype',
209
216
  patchType: PATCH_TYPES.ASSESS_SINK,
210
217
  post(data) {
211
- const values = extractValues(data.args[0], 'docClient', 'v2');
218
+ const values = extractValues('scan', data.args[0]);
212
219
  dynamoSink.check({
213
220
  values,
214
221
  methodName: 'DynamoDB.DocumentClient.prototype.scan',
@@ -219,27 +226,31 @@ module.exports = ({ common }) => {
219
226
  }
220
227
  });
221
228
 
222
- moduleHook.resolve({ name: moduleNameV3 }, (aws) => {
229
+ moduleHook.resolve({ name: '@aws-sdk/client-dynamodb' }, (aws) => {
223
230
  const client = aws.DynamoDBClient.prototype;
224
231
 
225
232
  patcher.patch(client, 'send', {
226
- name: `${moduleNameV3}.ScanCommand.prototype`,
233
+ name: '@aws-sdk/client-dynamodb.ScanCommand.prototype',
227
234
  patchType: PATCH_TYPES.ASSESS_SINK,
228
235
  alwaysRun: true,
229
236
  post(data) {
230
237
  if (!AsyncStorage.getContext()) return;
231
238
 
232
- if (data.args[0] instanceof aws.ScanCommand) {
233
- const values = extractValues(
234
- data.args[0].input,
235
- 'docClient',
236
- 'v3',
237
- ).filter(Boolean);
238
- dynamoSink.check({
239
- data,
240
- values,
241
- methodName: 'DynamoDBClient.ScanCommand',
242
- });
239
+ if (data.args[0] && data.args[0].constructor && data.args[0].input) {
240
+ const sendCommand = data.args[0].constructor.name;
241
+
242
+ if (Object.keys(trackSchemaCommands).includes(sendCommand)) {
243
+ const values = extractValues(
244
+ sendCommand,
245
+ data.args[0].input
246
+ ).filter(Boolean);
247
+
248
+ dynamoSink.check({
249
+ data,
250
+ values,
251
+ methodName: `DynamoDBClient.${sendCommand}`,
252
+ });
253
+ }
243
254
  }
244
255
  },
245
256
  });
@@ -257,7 +268,7 @@ module.exports = ({ common }) => {
257
268
 
258
269
  if (vulnerableString.length) {
259
270
  const ctxt = new CallContext(data);
260
- const signature = new Signature({ moduleName, methodName });
271
+ const signature = new Signature({ moduleName: 'aws-sdk', methodName });
261
272
  report({ ruleId, signature, input: vulnerableString[0], ctxt });
262
273
  }
263
274
  };
package/lib/libraries.js CHANGED
@@ -124,7 +124,7 @@ const getLibInfo = async (agent, eluEnabled) =>
124
124
 
125
125
  if (!nodeModsPath) {
126
126
  logger.error(
127
- `unable to read installed dependencies because a node_modules directory could not be detected given a package.json located at %s - use the agent.node.app_root configuration variable if installed in non-standard location`,
127
+ 'unable to read installed dependencies because a node_modules directory could not be detected given a package.json located at %s - use the agent.node.app_root configuration variable if installed in non-standard location',
128
128
  agent.appInfo.path
129
129
  );
130
130
  return AppUpdate.libraries;
@@ -57,7 +57,7 @@ module.exports.install = function() {
57
57
  handledErrors.add(error);
58
58
  } else {
59
59
  console.warn(
60
- `An Unhandled Rejection has been caught by the Contrast Security node-agent instrumentation. Error: ${error}`,
60
+ 'An Unhandled Rejection has been found in the instrumented code:\n%s', error
61
61
  );
62
62
  }
63
63
  }
@@ -198,7 +198,6 @@ class ProtectService {
198
198
  }
199
199
 
200
200
  const arg = {
201
- rules,
202
201
  // header names must be lowercase. should this be done in agent-lib?
203
202
  headers: req.rawHeaders.map((h, ix) => (ix & 1 ? h : h.toLowerCase()))
204
203
  };
@@ -208,7 +207,7 @@ class ProtectService {
208
207
  arg.queries = req.url.slice(questionMark + 1);
209
208
  }
210
209
 
211
- const findings = this.agentLib.scoreRequestConnect(arg, evalOptions);
210
+ const findings = this.agentLib.scoreRequestConnect(rules, arg, evalOptions);
212
211
 
213
212
  return findings;
214
213
  }
@@ -813,9 +812,9 @@ class ProtectService {
813
812
  // for each key, check out the value. the key is set in the code so
814
813
  // is not vulnerable.
815
814
  for (const key in params) {
816
- // items from scoreAtom() are only [{ruleId, score}, ...] because the key
815
+ // items from scoreAtom() return only [{ruleId, score}, ...] because the key
817
816
  // and inputType are already known and there is no path.
818
- const items = this.agentLib.scoreAtom(params[key], type, libRules);
817
+ const items = this.agentLib.scoreAtom(libRules, params[key], type);
819
818
  if (!items) {
820
819
  continue;
821
820
  }
@@ -865,7 +864,7 @@ class ProtectService {
865
864
  const filenames = Object.keys(event.data);
866
865
 
867
866
  for (const filename of filenames) {
868
- const items = this.agentLib.scoreAtom(filename, type, libRules);
867
+ const items = this.agentLib.scoreAtom(libRules, filename, type);
869
868
  if (!items) {
870
869
  continue;
871
870
  }
@@ -899,12 +898,9 @@ class ProtectService {
899
898
  queries.unshift(...q); return queries;
900
899
  }, []);
901
900
 
902
- const arg = {
903
- rules: rulesMask,
904
- queries,
905
- };
901
+ const arg = { queries };
906
902
 
907
- const findings = this.agentLib.scoreRequestConnect(arg, evalOptions);
903
+ const findings = this.agentLib.scoreRequestConnect(rulesMask, arg, evalOptions);
908
904
 
909
905
  this.handleAgentLibAnalysis({
910
906
  asyncStorageContext: event._ctxt,
@@ -920,8 +916,9 @@ class ProtectService {
920
916
  acc.unshift(key, value);
921
917
  return acc;
922
918
  }, []);
923
- const arg = { rules: this.getRulesMask(rules), cookies };
924
- const findings = this.agentLib.scoreRequestConnect(arg, evalOptions);
919
+ const rulesMask = this.getRulesMask(rules);
920
+ const arg = { cookies };
921
+ const findings = this.agentLib.scoreRequestConnect(rulesMask, arg, evalOptions);
925
922
  this.handleAgentLibAnalysis({
926
923
  asyncStorageContext: event._ctxt,
927
924
  appContext: {},
@@ -1136,7 +1133,7 @@ class ProtectService {
1136
1133
  * @param {Rule[]} rules Rules from which to build findings
1137
1134
  * @returns {Object[]} The findings from the rules
1138
1135
  */
1139
- createFindings(rules, samples) {
1136
+ createFindings(rules = [], samples) {
1140
1137
  const findings = [];
1141
1138
  const speedracer = this.reporter.speedracer &&
1142
1139
  this.config.agent.node.speedracer_input_analysis;
@@ -1167,7 +1164,7 @@ class ProtectService {
1167
1164
  const { _type, _value: input } = finding.sample.input;
1168
1165
  const type = this.agentLib.InputType[_type];
1169
1166
 
1170
- const alFinding = this.agentLib.scoreAtom(input, type, agentLibBit);
1167
+ const alFinding = this.agentLib.scoreAtom(agentLibBit, input, type);
1171
1168
  if (!alFinding) {
1172
1169
  return false;
1173
1170
  }
@@ -13,9 +13,10 @@ Copyright: 2022 Contrast Security, Inc
13
13
  way not consistent with the End User License Agreement.
14
14
  */
15
15
  'use strict';
16
- const readdir = require('recursive-readdir');
17
16
  const LibraryManifest = require('./library-manifest');
18
17
  const logger = require('../../../core/logger')('contrast:libraries');
18
+ const fs = require('fs');
19
+ const pathModule = require('path');
19
20
 
20
21
  module.exports = class Library {
21
22
  /**
@@ -53,7 +54,7 @@ module.exports = class Library {
53
54
  manifest: this.manifest.toSerializable(),
54
55
  usedClassCount: 0,
55
56
  classCount: this.fileCount,
56
- tags: this.tags
57
+ tags: this.tags,
57
58
  };
58
59
  }
59
60
 
@@ -88,15 +89,68 @@ module.exports = class Library {
88
89
  );
89
90
  }
90
91
 
92
+ readdir(path, callback) {
93
+ if (!callback) {
94
+ return new Promise((resolve, reject) => {
95
+ this.readdir(path, (err, data) => {
96
+ if (err) {
97
+ reject(err);
98
+ } else {
99
+ resolve(data);
100
+ }
101
+ });
102
+ });
103
+ }
104
+
105
+ let list = [];
106
+
107
+ fs.readdir(path, (err, files) => {
108
+ if (err) {
109
+ return callback(err);
110
+ }
111
+
112
+ let pending = files.length;
113
+ if (!pending) {
114
+ return callback(null, list);
115
+ }
116
+
117
+ files.forEach((file) => {
118
+ const filePath = pathModule.join(path, file);
119
+ fs.stat(filePath, (_err, stats) => {
120
+ if (_err) {
121
+ return callback(_err);
122
+ }
123
+
124
+ if (stats.isDirectory() && !filePath.endsWith('/node_modules')) {
125
+ this.readdir(filePath, (__err, res) => {
126
+ if (__err) {
127
+ return callback(__err);
128
+ }
129
+
130
+ list = list.concat(res);
131
+ pending -= 1;
132
+ if (!pending) {
133
+ return callback(null, list);
134
+ }
135
+ });
136
+ } else {
137
+ list.push(filePath);
138
+ pending -= 1;
139
+ if (!pending) {
140
+ return callback(null, list);
141
+ }
142
+ }
143
+ });
144
+ });
145
+ });
146
+ }
147
+
91
148
  /**
92
149
  * Counts all the valid files in a module directory
93
150
  */
94
151
  getComposition() {
95
152
  // ignore nested node_modules
96
- return readdir(this._path, [
97
- `${this._path}/node_modules/*`,
98
- `${this._path}/*/node_modules/*`
99
- ])
153
+ return this.readdir(this._path)
100
154
  .then((files) => {
101
155
  this.fileCount = files.filter((file) =>
102
156
  Library.applicableFile(file)
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ### 2.29.2 [See full changelog](https://gist.github.com/ichernev/1904b564f6679d9aac1ae08ce13bc45c)
5
+
6
+ * Release Apr 3 2022
7
+
8
+ Address https://github.com/advisories/GHSA-8hfj-j24r-96c4
9
+
4
10
  ### 2.29.1 [See full changelog](https://gist.github.com/marwahaha/cc478ba01a1292ab4bd4e861d164d99b)
5
11
 
6
12
  * Release Oct 6, 2020
@@ -8,9 +8,10 @@ export default moment.defineLocale('ar-kw', {
8
8
  months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
9
9
  '_'
10
10
  ),
11
- monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
12
- '_'
13
- ),
11
+ monthsShort:
12
+ 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
13
+ '_'
14
+ ),
14
15
  weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
15
16
  weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
16
17
  weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
@@ -1,5 +1,5 @@
1
1
  //! moment.js locale configuration
2
- //! locale : Arabic (Lybia) [ar-ly]
2
+ //! locale : Arabic (Libya) [ar-ly]
3
3
  //! author : Ali Hmer: https://github.com/kikoanis
4
4
 
5
5
  import moment from '../moment';
@@ -9,9 +9,10 @@ export default moment.defineLocale('ar-ma', {
9
9
  months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
10
10
  '_'
11
11
  ),
12
- monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
13
- '_'
14
- ),
12
+ monthsShort:
13
+ 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
14
+ '_'
15
+ ),
15
16
  weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
16
17
  weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
17
18
  weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
@@ -33,9 +33,10 @@ export default moment.defineLocale('ar-sa', {
33
33
  months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
34
34
  '_'
35
35
  ),
36
- monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
37
- '_'
38
- ),
36
+ monthsShort:
37
+ 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
38
+ '_'
39
+ ),
39
40
  weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
40
41
  weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
41
42
  weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
@@ -8,9 +8,10 @@ export default moment.defineLocale('ar-tn', {
8
8
  months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
9
9
  '_'
10
10
  ),
11
- monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
12
- '_'
13
- ),
11
+ monthsShort:
12
+ 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
13
+ '_'
14
+ ),
14
15
  weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
15
16
  weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
16
17
  weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
@@ -30,9 +30,10 @@ export default moment.defineLocale('az', {
30
30
  '_'
31
31
  ),
32
32
  monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
33
- weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(
34
- '_'
35
- ),
33
+ weekdays:
34
+ 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(
35
+ '_'
36
+ ),
36
37
  weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
37
38
  weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
38
39
  weekdaysParseExact: true,
@@ -37,20 +37,21 @@ export default moment.defineLocale('be', {
37
37
  format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(
38
38
  '_'
39
39
  ),
40
- standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
41
- '_'
42
- ),
40
+ standalone:
41
+ 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
42
+ '_'
43
+ ),
43
44
  },
44
- monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split(
45
- '_'
46
- ),
45
+ monthsShort:
46
+ 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
47
47
  weekdays: {
48
48
  format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(
49
49
  '_'
50
50
  ),
51
- standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
52
- '_'
53
- ),
51
+ standalone:
52
+ 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
53
+ '_'
54
+ ),
54
55
  isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/,
55
56
  },
56
57
  weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
@@ -33,9 +33,10 @@ export default moment.defineLocale('bn-bd', {
33
33
  months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
34
34
  '_'
35
35
  ),
36
- monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
37
- '_'
38
- ),
36
+ monthsShort:
37
+ 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
38
+ '_'
39
+ ),
39
40
  weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
40
41
  '_'
41
42
  ),
@@ -33,9 +33,10 @@ export default moment.defineLocale('bn', {
33
33
  months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
34
34
  '_'
35
35
  ),
36
- monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
37
- '_'
38
- ),
36
+ monthsShort:
37
+ 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
38
+ '_'
39
+ ),
39
40
  weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
40
41
  '_'
41
42
  ),
@@ -33,14 +33,16 @@ export default moment.defineLocale('bo', {
33
33
  months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(
34
34
  '_'
35
35
  ),
36
- monthsShort: 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(
37
- '_'
38
- ),
36
+ monthsShort:
37
+ 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(
38
+ '_'
39
+ ),
39
40
  monthsShortRegex: /^(ཟླ་\d{1,2})/,
40
41
  monthsParseExact: true,
41
- weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(
42
- '_'
43
- ),
42
+ weekdays:
43
+ 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(
44
+ '_'
45
+ ),
44
46
  weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(
45
47
  '_'
46
48
  ),
@@ -62,9 +62,12 @@ var monthsParse = [
62
62
  /^du/i,
63
63
  /^ker/i,
64
64
  ],
65
- monthsRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
66
- monthsStrictRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
67
- monthsShortStrictRegex = /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
65
+ monthsRegex =
66
+ /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
67
+ monthsStrictRegex =
68
+ /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
69
+ monthsShortStrictRegex =
70
+ /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
68
71
  fullWeekdaysParse = [
69
72
  /^sul/i,
70
73
  /^lun/i,