@zereight/mcp-gitlab 2.1.68 → 2.1.69

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.
@@ -0,0 +1,38 @@
1
+ const MAX_PATTERN_LENGTH = 200;
2
+ const NESTED_QUANTIFIER_PATTERN = /(\(.*[+*?].*\)|\[.*\])[+*?]/;
3
+ // Only allow safe characters in tool regex patterns to prevent regex injection (CodeQL)
4
+ const SAFE_PATTERN_CHARS = /^[a-zA-Z0-9_|^$().*+?{}[\]\\:,\s-]+$/;
5
+ export function compileDeniedToolsRegex(pattern) {
6
+ if (!pattern) {
7
+ return { regex: undefined, error: undefined };
8
+ }
9
+ if (pattern.length > MAX_PATTERN_LENGTH) {
10
+ return {
11
+ regex: undefined,
12
+ error: `GITLAB_DENIED_TOOLS_REGEX pattern exceeds ${MAX_PATTERN_LENGTH} chars. Ignoring.`,
13
+ };
14
+ }
15
+ if (!SAFE_PATTERN_CHARS.test(pattern)) {
16
+ return {
17
+ regex: undefined,
18
+ error: "GITLAB_DENIED_TOOLS_REGEX contains invalid characters. Ignoring.",
19
+ };
20
+ }
21
+ if (NESTED_QUANTIFIER_PATTERN.test(pattern)) {
22
+ return {
23
+ regex: undefined,
24
+ error: "GITLAB_DENIED_TOOLS_REGEX contains potentially unsafe nested quantifiers. Ignoring.",
25
+ };
26
+ }
27
+ try {
28
+ const regex = new RegExp(pattern);
29
+ regex.test("sample_tool_name");
30
+ return { regex, error: undefined };
31
+ }
32
+ catch {
33
+ return {
34
+ regex: undefined,
35
+ error: `Invalid GITLAB_DENIED_TOOLS_REGEX pattern: "${pattern}". Ignoring.`,
36
+ };
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "2.1.68",
3
+ "version": "2.1.69",
4
4
  "mcpName": "io.github.zereight/gitlab-mcp",
5
5
  "description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
6
6
  "keywords": [