mobbdev 1.4.22 → 1.4.23

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.
@@ -5441,6 +5441,48 @@ var languages = {
5441
5441
  init_client_generates();
5442
5442
  import { z as z11 } from "zod";
5443
5443
 
5444
+ // src/features/analysis/scm/shared/src/storedQuestionData/cpp/index.ts
5445
+ init_client_generates();
5446
+
5447
+ // src/features/analysis/scm/shared/src/storedQuestionData/cpp/commandInjection.ts
5448
+ var commandInjection = {
5449
+ isUnixShellCommandPart: {
5450
+ content: () => "Is the input data interpolated into a shell command (not the program name or shell structure)?",
5451
+ description: () => `\`system()\` / \`popen()\` hand the whole string to \`/bin/sh -c\`. Answer **yes** when the input is *data* placed into a fixed command, for example:
5452
+
5453
+ - \`sprintf(cmd, "grep %s file.txt", input); system(cmd);\`
5454
+ - \`sprintf(cmd, "ping -c 5 %s", input); system(cmd);\`
5455
+
5456
+ Answer **no** (the input is not plain data) when the input is:
5457
+
5458
+ 1. The program/executable itself:
5459
+ - \`system(input);\`
5460
+ - \`sprintf(cmd, "%s -x", input);\`
5461
+ 2. A command after a pipe or redirect:
5462
+ - \`sprintf(cmd, "cat file.txt | %s", input);\`
5463
+ 3. A part of a non-Unix or cross-platform shell command.
5464
+ 4. A part of embedded code in another language:
5465
+ - \`sprintf(cmd, "php -r \\"echo '%s';\\"", input);\`
5466
+ - \`sprintf(cmd, "awk '%s' file", input);\`
5467
+ 5. A flag/option that controls a tool's behaviour:
5468
+ - \`sprintf(cmd, "git --upload-pack %s", input);\``,
5469
+ guidance: () => "If yes and the command can run without a shell, it is rewritten to a no-shell argument-vector call (`posix_spawn`); if it needs the shell, the tainted argument is escaped in place so the shell keeps working. If the answer is no (the input controls the program or shell structure), there is no safe automatic rewrite, so the fix is withheld and the sink is left for manual review."
5470
+ },
5471
+ executableLocationPath: {
5472
+ content: () => "What is the absolute path of the directory containing the executable?",
5473
+ description: () => `When \`system()\` is rewritten to an \`execv()\` argument-vector call, the program is run by its path with **no \`$PATH\` search**, so a relative program name (e.g. \`tail\`) cannot be resolved and a poisoned \`PATH\` cannot be used to run a look-alike binary.
5474
+
5475
+ Provide the absolute directory that contains the executable (e.g. \`/usr/bin\`); the fix prepends it to the bare program name to form an absolute path.`,
5476
+ guidance: () => "Only asked when the program name in the command has no `/`. A program that is already an absolute or relative path (contains `/`) is used as written."
5477
+ }
5478
+ };
5479
+
5480
+ // src/features/analysis/scm/shared/src/storedQuestionData/cpp/index.ts
5481
+ var vulnerabilities11 = {
5482
+ ["CMDi" /* CmDi */]: commandInjection
5483
+ };
5484
+ var cpp_default = vulnerabilities11;
5485
+
5444
5486
  // src/features/analysis/scm/shared/src/storedQuestionData/csharp/index.ts
5445
5487
  init_client_generates();
5446
5488
 
@@ -5737,7 +5779,7 @@ var xxe = {
5737
5779
  };
5738
5780
 
5739
5781
  // src/features/analysis/scm/shared/src/storedQuestionData/csharp/index.ts
5740
- var vulnerabilities11 = {
5782
+ var vulnerabilities12 = {
5741
5783
  ["LOG_FORGING" /* LogForging */]: logForging,
5742
5784
  ["SSRF" /* Ssrf */]: ssrf2,
5743
5785
  ["XXE" /* Xxe */]: xxe,
@@ -5758,7 +5800,7 @@ var vulnerabilities11 = {
5758
5800
  ["SQL_Injection" /* SqlInjection */]: sqlInjection2,
5759
5801
  ["REQUEST_PARAMETERS_BOUND_VIA_INPUT" /* RequestParametersBoundViaInput */]: requestParametersBoundViaInput
5760
5802
  };
5761
- var csharp_default2 = vulnerabilities11;
5803
+ var csharp_default2 = vulnerabilities12;
5762
5804
 
5763
5805
  // src/features/analysis/scm/shared/src/storedQuestionData/go/index.ts
5764
5806
  init_client_generates();
@@ -5791,18 +5833,18 @@ var websocketMissingOriginCheck = {
5791
5833
  };
5792
5834
 
5793
5835
  // src/features/analysis/scm/shared/src/storedQuestionData/go/index.ts
5794
- var vulnerabilities12 = {
5836
+ var vulnerabilities13 = {
5795
5837
  ["LOG_FORGING" /* LogForging */]: logForging2,
5796
5838
  ["MISSING_SSL_MINVERSION" /* MissingSslMinversion */]: missingSslMinversion,
5797
5839
  ["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: websocketMissingOriginCheck
5798
5840
  };
5799
- var go_default2 = vulnerabilities12;
5841
+ var go_default2 = vulnerabilities13;
5800
5842
 
5801
5843
  // src/features/analysis/scm/shared/src/storedQuestionData/java/index.ts
5802
5844
  init_client_generates();
5803
5845
 
5804
5846
  // src/features/analysis/scm/shared/src/storedQuestionData/java/commandInjection.ts
5805
- var commandInjection = {
5847
+ var commandInjection2 = {
5806
5848
  isUnixShellCommandPart: {
5807
5849
  content: () => "Is the input part of Unix shell command?",
5808
5850
  description: () => `For example:
@@ -6256,10 +6298,10 @@ var xxe2 = {
6256
6298
  };
6257
6299
 
6258
6300
  // src/features/analysis/scm/shared/src/storedQuestionData/java/index.ts
6259
- var vulnerabilities13 = {
6301
+ var vulnerabilities14 = {
6260
6302
  ["SQL_Injection" /* SqlInjection */]: sqlInjection3,
6261
6303
  ["CMDi_relative_path_command" /* CmDiRelativePathCommand */]: relativePathCommand,
6262
- ["CMDi" /* CmDi */]: commandInjection,
6304
+ ["CMDi" /* CmDi */]: commandInjection2,
6263
6305
  ["CONFUSING_NAMING" /* ConfusingNaming */]: confusingNaming,
6264
6306
  ["ERROR_CONDTION_WITHOUT_ACTION" /* ErrorCondtionWithoutAction */]: errorConditionWithoutAction,
6265
6307
  ["XXE" /* Xxe */]: xxe2,
@@ -6284,7 +6326,7 @@ var vulnerabilities13 = {
6284
6326
  ["ERRONEOUS_STRING_COMPARE" /* ErroneousStringCompare */]: erroneousStringCompare,
6285
6327
  ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: duplicatedStrings
6286
6328
  };
6287
- var java_default2 = vulnerabilities13;
6329
+ var java_default2 = vulnerabilities14;
6288
6330
 
6289
6331
  // src/features/analysis/scm/shared/src/storedQuestionData/js/index.ts
6290
6332
  init_client_generates();
@@ -6299,7 +6341,7 @@ var csrf2 = {
6299
6341
  };
6300
6342
 
6301
6343
  // src/features/analysis/scm/shared/src/storedQuestionData/js/commandInjection.ts
6302
- var commandInjection2 = {
6344
+ var commandInjection3 = {
6303
6345
  isCommandExecutable: {
6304
6346
  content: () => "Commands can be intrinsically unsafe if they call out to other executables or run arbitary code",
6305
6347
  description: () => `Does the command fall into one of the following categories:
@@ -6613,8 +6655,8 @@ var xss3 = {
6613
6655
  };
6614
6656
 
6615
6657
  // src/features/analysis/scm/shared/src/storedQuestionData/js/index.ts
6616
- var vulnerabilities14 = {
6617
- ["CMDi" /* CmDi */]: commandInjection2,
6658
+ var vulnerabilities15 = {
6659
+ ["CMDi" /* CmDi */]: commandInjection3,
6618
6660
  ["GRAPHQL_DEPTH_LIMIT" /* GraphqlDepthLimit */]: graphqlDepthLimit,
6619
6661
  ["INSECURE_RANDOMNESS" /* InsecureRandomness */]: insecureRandomness2,
6620
6662
  ["SSRF" /* Ssrf */]: ssrf4,
@@ -6636,7 +6678,7 @@ var vulnerabilities14 = {
6636
6678
  ["HARDCODED_DOMAIN_IN_HTML" /* HardcodedDomainInHtml */]: hardcodedDomainInHtml,
6637
6679
  ["CSRF" /* Csrf */]: csrf2
6638
6680
  };
6639
- var js_default = vulnerabilities14;
6681
+ var js_default = vulnerabilities15;
6640
6682
 
6641
6683
  // src/features/analysis/scm/shared/src/storedQuestionData/python/index.ts
6642
6684
  init_client_generates();
@@ -6710,7 +6752,7 @@ var uncheckedLoopCondition3 = {
6710
6752
  };
6711
6753
 
6712
6754
  // src/features/analysis/scm/shared/src/storedQuestionData/python/index.ts
6713
- var vulnerabilities15 = {
6755
+ var vulnerabilities16 = {
6714
6756
  ["CSRF" /* Csrf */]: csrf2,
6715
6757
  ["LOG_FORGING" /* LogForging */]: logForging5,
6716
6758
  ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect3,
@@ -6719,7 +6761,7 @@ var vulnerabilities15 = {
6719
6761
  ["MISSING_ENCODING_FILE_OPEN" /* MissingEncodingFileOpen */]: missingEncoding,
6720
6762
  ["SSRF" /* Ssrf */]: ssrf5
6721
6763
  };
6722
- var python_default2 = vulnerabilities15;
6764
+ var python_default2 = vulnerabilities16;
6723
6765
 
6724
6766
  // src/features/analysis/scm/shared/src/storedQuestionData/xml/index.ts
6725
6767
  init_client_generates();
@@ -6736,10 +6778,10 @@ A value too high will cause performance issues up to and including denial of ser
6736
6778
  };
6737
6779
 
6738
6780
  // src/features/analysis/scm/shared/src/storedQuestionData/xml/index.ts
6739
- var vulnerabilities16 = {
6781
+ var vulnerabilities17 = {
6740
6782
  ["WEAK_XML_SCHEMA_UNBOUNDED_OCCURRENCES" /* WeakXmlSchemaUnboundedOccurrences */]: unboundedOccurrences
6741
6783
  };
6742
- var xml_default2 = vulnerabilities16;
6784
+ var xml_default2 = vulnerabilities17;
6743
6785
 
6744
6786
  // src/features/analysis/scm/shared/src/storedQuestionData/yaml/index.ts
6745
6787
  init_client_generates();
@@ -6772,12 +6814,12 @@ var writableFilesystemService = {
6772
6814
  };
6773
6815
 
6774
6816
  // src/features/analysis/scm/shared/src/storedQuestionData/yaml/index.ts
6775
- var vulnerabilities17 = {
6817
+ var vulnerabilities18 = {
6776
6818
  ["PORT_ALL_INTERFACES" /* PortAllInterfaces */]: portAllInterfaces,
6777
6819
  ["WRITABLE_FILESYSTEM_SERVICE" /* WritableFilesystemService */]: writableFilesystemService,
6778
6820
  ["NO_NEW_PRIVILEGES" /* NoNewPrivileges */]: noNewPrivileges
6779
6821
  };
6780
- var yaml_default = vulnerabilities17;
6822
+ var yaml_default = vulnerabilities18;
6781
6823
 
6782
6824
  // src/features/analysis/scm/shared/src/storedQuestionData/index.ts
6783
6825
  var StoredQuestionDataItemZ = z11.object({
@@ -6792,6 +6834,7 @@ var languages2 = {
6792
6834
  ["CSharp" /* CSharp */]: csharp_default2,
6793
6835
  ["Python" /* Python */]: python_default2,
6794
6836
  ["Go" /* Go */]: go_default2,
6837
+ ["Cpp" /* Cpp */]: cpp_default,
6795
6838
  ["YAML" /* Yaml */]: yaml_default
6796
6839
  };
6797
6840
 
package/dist/index.mjs CHANGED
@@ -5233,6 +5233,48 @@ var languages = {
5233
5233
  init_client_generates();
5234
5234
  import { z as z4 } from "zod";
5235
5235
 
5236
+ // src/features/analysis/scm/shared/src/storedQuestionData/cpp/index.ts
5237
+ init_client_generates();
5238
+
5239
+ // src/features/analysis/scm/shared/src/storedQuestionData/cpp/commandInjection.ts
5240
+ var commandInjection = {
5241
+ isUnixShellCommandPart: {
5242
+ content: () => "Is the input data interpolated into a shell command (not the program name or shell structure)?",
5243
+ description: () => `\`system()\` / \`popen()\` hand the whole string to \`/bin/sh -c\`. Answer **yes** when the input is *data* placed into a fixed command, for example:
5244
+
5245
+ - \`sprintf(cmd, "grep %s file.txt", input); system(cmd);\`
5246
+ - \`sprintf(cmd, "ping -c 5 %s", input); system(cmd);\`
5247
+
5248
+ Answer **no** (the input is not plain data) when the input is:
5249
+
5250
+ 1. The program/executable itself:
5251
+ - \`system(input);\`
5252
+ - \`sprintf(cmd, "%s -x", input);\`
5253
+ 2. A command after a pipe or redirect:
5254
+ - \`sprintf(cmd, "cat file.txt | %s", input);\`
5255
+ 3. A part of a non-Unix or cross-platform shell command.
5256
+ 4. A part of embedded code in another language:
5257
+ - \`sprintf(cmd, "php -r \\"echo '%s';\\"", input);\`
5258
+ - \`sprintf(cmd, "awk '%s' file", input);\`
5259
+ 5. A flag/option that controls a tool's behaviour:
5260
+ - \`sprintf(cmd, "git --upload-pack %s", input);\``,
5261
+ guidance: () => "If yes and the command can run without a shell, it is rewritten to a no-shell argument-vector call (`posix_spawn`); if it needs the shell, the tainted argument is escaped in place so the shell keeps working. If the answer is no (the input controls the program or shell structure), there is no safe automatic rewrite, so the fix is withheld and the sink is left for manual review."
5262
+ },
5263
+ executableLocationPath: {
5264
+ content: () => "What is the absolute path of the directory containing the executable?",
5265
+ description: () => `When \`system()\` is rewritten to an \`execv()\` argument-vector call, the program is run by its path with **no \`$PATH\` search**, so a relative program name (e.g. \`tail\`) cannot be resolved and a poisoned \`PATH\` cannot be used to run a look-alike binary.
5266
+
5267
+ Provide the absolute directory that contains the executable (e.g. \`/usr/bin\`); the fix prepends it to the bare program name to form an absolute path.`,
5268
+ guidance: () => "Only asked when the program name in the command has no `/`. A program that is already an absolute or relative path (contains `/`) is used as written."
5269
+ }
5270
+ };
5271
+
5272
+ // src/features/analysis/scm/shared/src/storedQuestionData/cpp/index.ts
5273
+ var vulnerabilities11 = {
5274
+ ["CMDi" /* CmDi */]: commandInjection
5275
+ };
5276
+ var cpp_default = vulnerabilities11;
5277
+
5236
5278
  // src/features/analysis/scm/shared/src/storedQuestionData/csharp/index.ts
5237
5279
  init_client_generates();
5238
5280
 
@@ -5529,7 +5571,7 @@ var xxe = {
5529
5571
  };
5530
5572
 
5531
5573
  // src/features/analysis/scm/shared/src/storedQuestionData/csharp/index.ts
5532
- var vulnerabilities11 = {
5574
+ var vulnerabilities12 = {
5533
5575
  ["LOG_FORGING" /* LogForging */]: logForging,
5534
5576
  ["SSRF" /* Ssrf */]: ssrf2,
5535
5577
  ["XXE" /* Xxe */]: xxe,
@@ -5550,7 +5592,7 @@ var vulnerabilities11 = {
5550
5592
  ["SQL_Injection" /* SqlInjection */]: sqlInjection2,
5551
5593
  ["REQUEST_PARAMETERS_BOUND_VIA_INPUT" /* RequestParametersBoundViaInput */]: requestParametersBoundViaInput
5552
5594
  };
5553
- var csharp_default2 = vulnerabilities11;
5595
+ var csharp_default2 = vulnerabilities12;
5554
5596
 
5555
5597
  // src/features/analysis/scm/shared/src/storedQuestionData/go/index.ts
5556
5598
  init_client_generates();
@@ -5583,18 +5625,18 @@ var websocketMissingOriginCheck = {
5583
5625
  };
5584
5626
 
5585
5627
  // src/features/analysis/scm/shared/src/storedQuestionData/go/index.ts
5586
- var vulnerabilities12 = {
5628
+ var vulnerabilities13 = {
5587
5629
  ["LOG_FORGING" /* LogForging */]: logForging2,
5588
5630
  ["MISSING_SSL_MINVERSION" /* MissingSslMinversion */]: missingSslMinversion,
5589
5631
  ["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: websocketMissingOriginCheck
5590
5632
  };
5591
- var go_default2 = vulnerabilities12;
5633
+ var go_default2 = vulnerabilities13;
5592
5634
 
5593
5635
  // src/features/analysis/scm/shared/src/storedQuestionData/java/index.ts
5594
5636
  init_client_generates();
5595
5637
 
5596
5638
  // src/features/analysis/scm/shared/src/storedQuestionData/java/commandInjection.ts
5597
- var commandInjection = {
5639
+ var commandInjection2 = {
5598
5640
  isUnixShellCommandPart: {
5599
5641
  content: () => "Is the input part of Unix shell command?",
5600
5642
  description: () => `For example:
@@ -6048,10 +6090,10 @@ var xxe2 = {
6048
6090
  };
6049
6091
 
6050
6092
  // src/features/analysis/scm/shared/src/storedQuestionData/java/index.ts
6051
- var vulnerabilities13 = {
6093
+ var vulnerabilities14 = {
6052
6094
  ["SQL_Injection" /* SqlInjection */]: sqlInjection3,
6053
6095
  ["CMDi_relative_path_command" /* CmDiRelativePathCommand */]: relativePathCommand,
6054
- ["CMDi" /* CmDi */]: commandInjection,
6096
+ ["CMDi" /* CmDi */]: commandInjection2,
6055
6097
  ["CONFUSING_NAMING" /* ConfusingNaming */]: confusingNaming,
6056
6098
  ["ERROR_CONDTION_WITHOUT_ACTION" /* ErrorCondtionWithoutAction */]: errorConditionWithoutAction,
6057
6099
  ["XXE" /* Xxe */]: xxe2,
@@ -6076,7 +6118,7 @@ var vulnerabilities13 = {
6076
6118
  ["ERRONEOUS_STRING_COMPARE" /* ErroneousStringCompare */]: erroneousStringCompare,
6077
6119
  ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: duplicatedStrings
6078
6120
  };
6079
- var java_default2 = vulnerabilities13;
6121
+ var java_default2 = vulnerabilities14;
6080
6122
 
6081
6123
  // src/features/analysis/scm/shared/src/storedQuestionData/js/index.ts
6082
6124
  init_client_generates();
@@ -6091,7 +6133,7 @@ var csrf2 = {
6091
6133
  };
6092
6134
 
6093
6135
  // src/features/analysis/scm/shared/src/storedQuestionData/js/commandInjection.ts
6094
- var commandInjection2 = {
6136
+ var commandInjection3 = {
6095
6137
  isCommandExecutable: {
6096
6138
  content: () => "Commands can be intrinsically unsafe if they call out to other executables or run arbitary code",
6097
6139
  description: () => `Does the command fall into one of the following categories:
@@ -6405,8 +6447,8 @@ var xss3 = {
6405
6447
  };
6406
6448
 
6407
6449
  // src/features/analysis/scm/shared/src/storedQuestionData/js/index.ts
6408
- var vulnerabilities14 = {
6409
- ["CMDi" /* CmDi */]: commandInjection2,
6450
+ var vulnerabilities15 = {
6451
+ ["CMDi" /* CmDi */]: commandInjection3,
6410
6452
  ["GRAPHQL_DEPTH_LIMIT" /* GraphqlDepthLimit */]: graphqlDepthLimit,
6411
6453
  ["INSECURE_RANDOMNESS" /* InsecureRandomness */]: insecureRandomness2,
6412
6454
  ["SSRF" /* Ssrf */]: ssrf4,
@@ -6428,7 +6470,7 @@ var vulnerabilities14 = {
6428
6470
  ["HARDCODED_DOMAIN_IN_HTML" /* HardcodedDomainInHtml */]: hardcodedDomainInHtml,
6429
6471
  ["CSRF" /* Csrf */]: csrf2
6430
6472
  };
6431
- var js_default = vulnerabilities14;
6473
+ var js_default = vulnerabilities15;
6432
6474
 
6433
6475
  // src/features/analysis/scm/shared/src/storedQuestionData/python/index.ts
6434
6476
  init_client_generates();
@@ -6502,7 +6544,7 @@ var uncheckedLoopCondition3 = {
6502
6544
  };
6503
6545
 
6504
6546
  // src/features/analysis/scm/shared/src/storedQuestionData/python/index.ts
6505
- var vulnerabilities15 = {
6547
+ var vulnerabilities16 = {
6506
6548
  ["CSRF" /* Csrf */]: csrf2,
6507
6549
  ["LOG_FORGING" /* LogForging */]: logForging5,
6508
6550
  ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect3,
@@ -6511,7 +6553,7 @@ var vulnerabilities15 = {
6511
6553
  ["MISSING_ENCODING_FILE_OPEN" /* MissingEncodingFileOpen */]: missingEncoding,
6512
6554
  ["SSRF" /* Ssrf */]: ssrf5
6513
6555
  };
6514
- var python_default2 = vulnerabilities15;
6556
+ var python_default2 = vulnerabilities16;
6515
6557
 
6516
6558
  // src/features/analysis/scm/shared/src/storedQuestionData/xml/index.ts
6517
6559
  init_client_generates();
@@ -6528,10 +6570,10 @@ A value too high will cause performance issues up to and including denial of ser
6528
6570
  };
6529
6571
 
6530
6572
  // src/features/analysis/scm/shared/src/storedQuestionData/xml/index.ts
6531
- var vulnerabilities16 = {
6573
+ var vulnerabilities17 = {
6532
6574
  ["WEAK_XML_SCHEMA_UNBOUNDED_OCCURRENCES" /* WeakXmlSchemaUnboundedOccurrences */]: unboundedOccurrences
6533
6575
  };
6534
- var xml_default2 = vulnerabilities16;
6576
+ var xml_default2 = vulnerabilities17;
6535
6577
 
6536
6578
  // src/features/analysis/scm/shared/src/storedQuestionData/yaml/index.ts
6537
6579
  init_client_generates();
@@ -6564,12 +6606,12 @@ var writableFilesystemService = {
6564
6606
  };
6565
6607
 
6566
6608
  // src/features/analysis/scm/shared/src/storedQuestionData/yaml/index.ts
6567
- var vulnerabilities17 = {
6609
+ var vulnerabilities18 = {
6568
6610
  ["PORT_ALL_INTERFACES" /* PortAllInterfaces */]: portAllInterfaces,
6569
6611
  ["WRITABLE_FILESYSTEM_SERVICE" /* WritableFilesystemService */]: writableFilesystemService,
6570
6612
  ["NO_NEW_PRIVILEGES" /* NoNewPrivileges */]: noNewPrivileges
6571
6613
  };
6572
- var yaml_default = vulnerabilities17;
6614
+ var yaml_default = vulnerabilities18;
6573
6615
 
6574
6616
  // src/features/analysis/scm/shared/src/storedQuestionData/index.ts
6575
6617
  var StoredQuestionDataItemZ = z4.object({
@@ -6584,6 +6626,7 @@ var languages2 = {
6584
6626
  ["CSharp" /* CSharp */]: csharp_default2,
6585
6627
  ["Python" /* Python */]: python_default2,
6586
6628
  ["Go" /* Go */]: go_default2,
6629
+ ["Cpp" /* Cpp */]: cpp_default,
6587
6630
  ["YAML" /* Yaml */]: yaml_default
6588
6631
  };
6589
6632
  var storedQuestionData_default = languages2;
@@ -9598,48 +9641,65 @@ function getGithubSdk(params = {}) {
9598
9641
  return false;
9599
9642
  }
9600
9643
  },
9601
- async getGithubRepoList() {
9644
+ async listAuthenticatedUserReposPage(params2) {
9645
+ const {
9646
+ sort = { field: "updated", order: "desc" },
9647
+ perPage = 10,
9648
+ page = 1
9649
+ } = params2;
9650
+ const githubSort = sort.field === "name" ? "full_name" : sort.field === "created" ? "created" : "updated";
9602
9651
  try {
9603
- const allRepos = [];
9604
- let page = 1;
9605
- const perPage = 100;
9606
- let hasMore = true;
9607
- while (hasMore) {
9608
- const githubRepos = await octokit.request(GET_USER_REPOS, {
9609
- sort: "updated",
9610
- per_page: perPage,
9611
- page
9612
- });
9613
- for (const repo of githubRepos.data) {
9614
- allRepos.push({
9615
- repoName: repo.name,
9616
- repoUrl: repo.html_url,
9617
- repoOwner: repo.owner.login,
9618
- repoLanguages: repo.language ? [repo.language] : [],
9619
- repoIsPublic: !repo.private,
9620
- repoUpdatedAt: repo.updated_at
9621
- });
9622
- }
9623
- hasMore = githubRepos.data.length >= perPage;
9624
- page++;
9625
- }
9626
- return allRepos;
9652
+ const githubRepos = await octokit.request(GET_USER_REPOS, {
9653
+ sort: githubSort,
9654
+ direction: sort.order,
9655
+ per_page: perPage,
9656
+ page
9657
+ });
9658
+ const items = githubRepos.data.map((repo) => ({
9659
+ repoName: repo.name,
9660
+ repoUrl: repo.html_url,
9661
+ repoOwner: repo.owner.login,
9662
+ repoLanguages: repo.language ? [repo.language] : [],
9663
+ repoIsPublic: !repo.private,
9664
+ repoUpdatedAt: repo.updated_at
9665
+ }));
9666
+ return {
9667
+ items,
9668
+ hasMore: githubRepos.data.length >= perPage
9669
+ };
9627
9670
  } catch (e) {
9628
9671
  if (e instanceof RequestError && e.status === 401) {
9629
9672
  console.warn(
9630
9673
  "GitHub API returned 401 Unauthorized when listing repos - token may be expired or lack repo scope"
9631
9674
  );
9632
- return [];
9675
+ return { items: [], hasMore: false };
9633
9676
  }
9634
9677
  if (e instanceof RequestError && e.status === 404) {
9635
9678
  console.warn(
9636
9679
  "GitHub API returned 404 Not Found when listing repos - user may not exist"
9637
9680
  );
9638
- return [];
9681
+ return { items: [], hasMore: false };
9639
9682
  }
9640
9683
  throw e;
9641
9684
  }
9642
9685
  },
9686
+ async getGithubRepoList() {
9687
+ const allRepos = [];
9688
+ let page = 1;
9689
+ const perPage = 100;
9690
+ let hasMore = true;
9691
+ while (hasMore) {
9692
+ const pageResult = await this.listAuthenticatedUserReposPage({
9693
+ sort: { field: "updated", order: "desc" },
9694
+ perPage,
9695
+ page
9696
+ });
9697
+ allRepos.push(...pageResult.items);
9698
+ hasMore = pageResult.hasMore;
9699
+ page++;
9700
+ }
9701
+ return allRepos;
9702
+ },
9643
9703
  async getGithubRepoDefaultBranch(repoUrl) {
9644
9704
  const { owner, repo } = parseGithubOwnerAndRepo(repoUrl);
9645
9705
  const repos = await octokit.rest.repos.get({ repo, owner });
@@ -10699,23 +10759,25 @@ var GithubSCMLib = class extends SCMLib {
10699
10759
  });
10700
10760
  }
10701
10761
  /**
10702
- * Override searchRepos to use GitHub's Search API for efficient pagination.
10703
- * This is much faster than fetching all repos and filtering in-memory.
10704
- *
10705
- * Note: GitHub Search API doesn't support sorting by name, so when name sorting
10706
- * is requested, we fall back to fetching all repos and sorting in-memory.
10762
+ * Override searchRepos for efficient server-side pagination.
10763
+ * - With scmOrg: GitHub Search API (`org:…`)
10764
+ * - Without scmOrg: paginated `GET /user/repos`
10765
+ * - Name sort: in-memory over full list
10707
10766
  */
10708
10767
  async searchRepos(params) {
10709
10768
  this._validateAccessToken();
10710
10769
  const sort = params.sort || { field: "updated", order: "desc" };
10711
- if (!params.scmOrg || sort.field === "name") {
10770
+ if (sort.field === "name") {
10712
10771
  return this.searchReposInMemory(params);
10713
10772
  }
10773
+ if (!params.scmOrg) {
10774
+ return this.searchReposWithUserReposApi(params);
10775
+ }
10714
10776
  return this.searchReposWithApi(params);
10715
10777
  }
10716
10778
  /**
10717
10779
  * Search repos by fetching all and sorting/paginating in-memory.
10718
- * Used when name sorting is requested or no organization is provided.
10780
+ * Used only when name sorting is requested.
10719
10781
  */
10720
10782
  async searchReposInMemory(params) {
10721
10783
  const repos = await this.getRepoList(params.scmOrg);
@@ -10743,6 +10805,24 @@ var GithubSCMLib = class extends SCMLib {
10743
10805
  hasMore: nextOffset < sortedRepos.length
10744
10806
  };
10745
10807
  }
10808
+ /**
10809
+ * Paginated repo list for authenticated user when no GitHub org is configured.
10810
+ */
10811
+ async searchReposWithUserReposApi(params) {
10812
+ const page = parseCursorSafe(params.cursor, 1);
10813
+ const perPage = params.limit || 10;
10814
+ const sort = params.sort || { field: "updated", order: "desc" };
10815
+ const pageResult = await this.githubSdk.listAuthenticatedUserReposPage({
10816
+ sort,
10817
+ perPage,
10818
+ page
10819
+ });
10820
+ return {
10821
+ results: pageResult.items,
10822
+ nextCursor: pageResult.hasMore ? String(page + 1) : void 0,
10823
+ hasMore: pageResult.hasMore
10824
+ };
10825
+ }
10746
10826
  /**
10747
10827
  * Search repos using GitHub Search API for efficient server-side pagination.
10748
10828
  * Only supports date-based sorting (updated/created).
@@ -19641,7 +19721,7 @@ function createLogger(config2) {
19641
19721
 
19642
19722
  // src/features/claude_code/hook_logger.ts
19643
19723
  var DD_RUM_TOKEN = true ? "pubf59c0182545bfb4c299175119f1abf9b" : "";
19644
- var CLI_VERSION = true ? "1.4.22" : "unknown";
19724
+ var CLI_VERSION = true ? "1.4.23" : "unknown";
19645
19725
  var NAMESPACE = "mobbdev-claude-code-hook-logs";
19646
19726
  var claudeCodeVersion;
19647
19727
  function buildDdTags() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
4
4
  "description": "Automated secure code remediation tool",
5
5
  "repository": "git+https://github.com/mobb-dev/bugsy.git",
6
6
  "main": "dist/index.mjs",