Skip to content

Commit 64b712b

Browse files
1 parent aa9beaa commit 64b712b

File tree

3 files changed

+247
-0
lines changed

3 files changed

+247
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-7cqv-qcq2-r765",
4+
"modified": "2025-12-08T17:56:57Z",
5+
"published": "2025-12-08T17:56:57Z",
6+
"aliases": [
7+
"CVE-2025-66508"
8+
],
9+
"summary": "1Panel IP Access Control Bypass via Untrusted X-Forwarded-For Headers",
10+
"details": "### Summary\nThe server trusts all reverse-proxy headers by default, so any remote client can spoof `X-Forwarded-For` to bypass IP-based protections (AllowIPs, API IP whitelist, “localhost-only” checks). All IP-based access control becomes ineffective.\n\n### Details\n- Gin is created with defaults (`gin.Default()`), which sets `TrustedProxies = 0.0.0.0/0` and uses `X-Forwarded-For`/`X-Real-IP` to compute `ClientIP()`.\n\n- IP-based controls rely on `ClientIP()`:\n - AllowIPs / BindDomain (core/middleware/ip_limit.go, core/utils/security/security.go).\n - API IP whitelist (core/middleware/api_auth.go).\n - \"localhost-only\" checks that depend on `ClientIP()`.\n\n- Because no trusted-proxy range is enforced, any client can send `X-Forwarded-For: 127.0.0.1` (or a whitelisted IP) and be treated as coming from that address.\n\n### Impact\nAll IP-based access control is rendered ineffective: remote clients can masquerade as localhost or any whitelisted IP, defeating AllowIPs, API IP whitelists, and “localhost-only” protections.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/1Panel-dev/1Panel"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "2.0.14"
32+
}
33+
]
34+
}
35+
]
36+
},
37+
{
38+
"package": {
39+
"ecosystem": "Go",
40+
"name": "github.com/1Panel-dev/1Panel/agent"
41+
},
42+
"ranges": [
43+
{
44+
"type": "ECOSYSTEM",
45+
"events": [
46+
{
47+
"introduced": "0"
48+
},
49+
{
50+
"fixed": "0.0.0-20251201063338-94f7d78cc976"
51+
}
52+
]
53+
}
54+
]
55+
}
56+
],
57+
"references": [
58+
{
59+
"type": "WEB",
60+
"url": "https://github.com/1Panel-dev/1Panel/security/advisories/GHSA-7cqv-qcq2-r765"
61+
},
62+
{
63+
"type": "WEB",
64+
"url": "https://github.com/1Panel-dev/1Panel/commit/94f7d78cc9768ee244da33e09408017d1f68b5ed"
65+
},
66+
{
67+
"type": "PACKAGE",
68+
"url": "https://github.com/1Panel-dev/1Panel"
69+
}
70+
],
71+
"database_specific": {
72+
"cwe_ids": [
73+
"CWE-290"
74+
],
75+
"severity": "MODERATE",
76+
"github_reviewed": true,
77+
"github_reviewed_at": "2025-12-08T17:56:57Z",
78+
"nvd_published_at": null
79+
}
80+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-m98w-cqp3-qcqr",
4+
"modified": "2025-12-08T17:57:26Z",
5+
"published": "2025-12-08T17:57:26Z",
6+
"aliases": [
7+
"CVE-2025-66565"
8+
],
9+
"summary": "Fiber Utils UUIDv4 and UUID Silent Fallback to Predictable Values",
10+
"details": "## Summary\n\nCritical security vulnerabilities exist in both the `UUIDv4()` and `UUID()` functions of the `github.com/gofiber/utils` package. When the system's cryptographic random number generator (`crypto/rand`) fails, both functions silently fall back to returning predictable UUID values, including the zero UUID `\"00000000-0000-0000-0000-000000000000\"`. This compromises the security of all Fiber applications using these functions for security-critical operations.\n\n**Both functions are vulnerable to the same root cause (`crypto/rand` failure):**\n- `UUIDv4()`: Indirect vulnerability through `uuid.NewRandom()` → `crypto/rand.Read()` → fallback to `UUID()`\n- `UUID()`: Direct vulnerability through `crypto/rand.Read(uuidSeed[:])` → silent zero UUID return\n\n## Vulnerability Details\n\n### Affected Functions\n- **Package**: `github.com/gofiber/utils`\n- **Functions**: `UUIDv4()` and `UUID()`\n- **Return Type**: `string` (both functions)\n- **Locations**: `common.go:93-99` (UUIDv4), `common.go:60-89` (UUID)\n\n### Technical Description\n\nThe vulnerability occurs through two related but distinct failure paths, both ultimately caused by `crypto/rand.Read()` failures:\n\n#### Primary Path: UUIDv4() Vulnerability\n1. `UUIDv4()` calls `google/uuid.NewRandom()` which internally uses `crypto/rand.Read()`\n2. If `uuid.NewRandom()` fails due to entropy exhaustion, `UUIDv4()` falls back to the internal `UUID()` function\n3. **No error is returned to the application** - silent security failure occurs\n\n#### Secondary Path: UUID() Vulnerability\n1. `UUID()` directly calls `crypto/rand.Read(uuidSeed[:])` to seed its internal state\n2. If seeding fails, `UUID()` **silently fails** and returns the zero UUID `\"00000000-0000-0000-0000-000000000000\"`\n3. Applications receive predictable UUIDs with no indication of the security failure\n\n**Both functions are vulnerable to the same root cause (`crypto/rand` failure):**\n- `UUIDv4()`: Indirect vulnerability through `uuid.NewRandom()` → `crypto/rand.Read()` → fallback to `UUID()`\n- `UUID()`: Direct vulnerability through `crypto/rand.Read(uuidSeed[:])` → silent zero UUID return\n\n### Code Analysis\n\n#### UUIDv4() Vulnerability Path\n```go\n// Vulnerable code in UUIDv4() - Indirect rand.Read() failure\nfunc UUIDv4() string {\n\ttoken, err := uuid.NewRandom() // Uses crypto/rand.Read() internally\n\tif err != nil {\n\t\treturn UUID() // Dangerous fallback - no error returned to application\n\t}\n\treturn token.String()\n}\n```\n\n#### UUID() Vulnerability Path\n```go\n// Vulnerable fallback function UUID() - Direct rand.Read() failure\nfunc UUID() string {\n\tuuidSetup.Do(func() {\n\t\tif _, err := rand.Read(uuidSeed[:]); err != nil { // Direct crypto/rand.Read() call\n\t\t\treturn // Silent failure - no seeding, uuidCounter remains 0\n\t\t}\n\t\tuuidCounter = binary.LittleEndian.Uint64(uuidSeed[:8])\n\t})\n\tif atomic.LoadUint64(&uuidCounter) <= 0 {\n\t\treturn \"00000000-0000-0000-0000-000000000000\" // Zero UUID returned silently\n\t}\n\t// ... generate UUID from counter\n}\n```\n\n**Root Cause**: Both vulnerabilities stem from `crypto/rand.Read()` failures, but occur through different code paths with the same dangerous silent failure behavior.\n\n## Security Impact\n\n### Severity: CRITICAL\n\nThis issue is especially severe because many Fiber middleware packages (session, CSRF, auth, rate-limit, request-ID, etc.) default to `utils.UUIDv4()` for generating security-sensitive identifiers. A failure in `crypto/rand` would cause **every generated identifier across the entire application** to collapse to a single predictable value (often the zero UUID), resulting in:\n\n* **Session fixation / universal session hijack**\n* **CSRF token predictability and bypass**\n* **Authentication token replay**\n* **Global identifier collisions leading to severe application breakage**\n* **Potential application-wide DoS** due to every request using the same “unique” key, causing cache overwrites, session stomping, corrupted internal maps, and loss of isolation across all users\n\n### Attack Scenario\n\nImportantly, while **true entropy exhaustion is extremely rare on modern Linux systems**, *entropy access failures* (e.g., restricted `/dev/random`/`/dev/urandom` access, broken container environments, sandbox restrictions, misconfigured VMs, or FIPS-mode RNG failures) are more realistic failure modes. In these scenarios, `crypto/rand` may return errors immediately — triggering the vulnerable fallback paths.\n\n### Real-World Impact\n\n* **Session fixation or hijacking** (predictable session IDs)\n* **CSRF token forging** or bypass\n* **Authentication replay / token prediction**\n* **Potential denial-of-service (DoS)** key-based structures (sessions, rate-limits, caches, CSRF token stores) collapse into a single shared key if the zero UUID is returned, causing widespread overwrite, lock contention, or state corruption\n* **Request-ID collisions**, undermining logging and trace integrity\n* **General compromise** of confidentiality, integrity, and authorization logic relying on UUIDs for uniqueness or secrecy\n\n## Proof of Concept\n\nThe vulnerability can be demonstrated by examining the fallback behavior in the source code. When `crypto/rand` fails:\n\n1. `uuid.NewRandom()` fails (indirect `crypto/rand.Read()` failure)\n2. `UUIDv4()` calls `UUID()` as fallback with no error returned\n3. `UUID()` seeding fails directly via `crypto/rand.Read(uuidSeed[:])`\n4. Zero UUID `\"00000000-0000-0000-0000-000000000000\"` is returned silently\n5. No error is propagated to the application from either function\n\nBoth `UUIDv4()` and `UUID()` exhibit the same dangerous silent failure behavior when `crypto/rand` is unavailable.\n\n## Affected Versions\n\n- All versions of `github.com/gofiber/utils` containing the `UUIDv4()` function\n- Applications using Fiber middleware that depend on `UUIDv4()` for security\n\n## Mitigation\n\n### Immediate Workaround\nReplace usage of `utils.UUIDv4()` with `uuid.New()` or wait for fix:\n\n```go\n// Instead of:\nsessionID := utils.UUIDv4()\n\n// Use:\nsessionID := uuid.New()\n```\n\n### Recommended Fix\nModify `utils.UUIDv4()` and `utils.UUID()`to fail explicitly when cryptographic randomness is unavailable:\n\n```go\nfunc UUIDv4() string {\n\ttoken, err := uuid.NewRandom()\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"utils: failed to generate secure UUID: %v\", err))\n\t}\n\treturn token.String()\n}\n```\n\n```go\nfunc UUID() string {\n uuidSetup.Do(func() {\n if _, err := rand.Read(uuidSeed[:]); err != nil {\n panic(fmt.Sprintf(\"utils: failed to seed UUID generator: %v\", err))\n }\n uuidCounter = binary.LittleEndian.Uint64(uuidSeed[:8])\n })\n if atomic.LoadUint64(&uuidCounter) <= 0 {\n panic(\"utils: UUID generator not properly seeded\")\n }\n // ... generate UUID from counter\n}\n```\n\n## Detection\n\nApplications can detect if they're affected by:\n1. Checking if they use `github.com/gofiber/utils` package\n2. Searching for `UUIDv4()` usage in security-critical code paths\n3. Reviewing middleware configurations that use UUIDv4 as defaults\n\nor\n\n1. Checking to see if any Fiber middleware is used that relies on defaults of `UUIDv4()` for security identifiers.\n\n## Contact\n\nReported by: [@sixcolors](github.com/sixcolors)\n\n## Classification\n\n- **OWASP**: A02:2021 - Cryptographic Failures\n- **Impact**: Complete compromise of application security model\n- **Exploitability**: Medium (requires entropy exhaustion)\n- **Scope**: All Fiber applications using affected middleware",
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/gofiber/utils/v2"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "2.0.0-rc.4"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "< 2.0.0-rc.3.0.20251205210924-6c6cf047032b"
38+
}
39+
},
40+
{
41+
"package": {
42+
"ecosystem": "Go",
43+
"name": "github.com/gofiber/utils"
44+
},
45+
"ranges": [
46+
{
47+
"type": "ECOSYSTEM",
48+
"events": [
49+
{
50+
"introduced": "0"
51+
},
52+
{
53+
"last_affected": "1.2.0"
54+
}
55+
]
56+
}
57+
]
58+
}
59+
],
60+
"references": [
61+
{
62+
"type": "WEB",
63+
"url": "https://github.com/gofiber/utils/security/advisories/GHSA-m98w-cqp3-qcqr"
64+
},
65+
{
66+
"type": "WEB",
67+
"url": "https://github.com/gofiber/utils/commit/6c6cf047032b9c8dff43d29f990b4b10e9b02d47"
68+
},
69+
{
70+
"type": "PACKAGE",
71+
"url": "https://github.com/gofiber/utils"
72+
}
73+
],
74+
"database_specific": {
75+
"cwe_ids": [
76+
"CWE-252",
77+
"CWE-331",
78+
"CWE-338"
79+
],
80+
"severity": "CRITICAL",
81+
"github_reviewed": true,
82+
"github_reviewed_at": "2025-12-08T17:57:26Z",
83+
"nvd_published_at": null
84+
}
85+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-qmg5-v42x-qqhq",
4+
"modified": "2025-12-08T17:56:28Z",
5+
"published": "2025-12-08T17:56:27Z",
6+
"aliases": [
7+
"CVE-2025-66507"
8+
],
9+
"summary": "1Panel – CAPTCHA Bypass via Client-Controlled Flag ",
10+
"details": "### Summary\n\nA CAPTCHA bypass vulnerability in the 1Panel authentication API allows an unauthenticated attacker to disable CAPTCHA verification by abusing a client-controlled parameter. Because the server previously trusted this value without proper validation, CAPTCHA protections could be bypassed, enabling automated login attempts and significantly increasing the risk of account takeover (ATO).\n\n### Details\n\nThe /api/login endpoint accepts a boolean field named ignoreCaptcha directly from the client request body:\n\n`\"ignoreCaptcha\": true`\n\n\nThe backend implementation uses this value to determine whether CAPTCHA validation should be performed:\n\n```\nif !req.IgnoreCaptcha {\n if errMsg := captcha.VerifyCode(req.CaptchaID, req.Captcha); errMsg != \"\" {\n helper.BadAuth(c, errMsg, nil)\n return\n }\n}\n\n```\n\nBecause req.IgnoreCaptcha is taken directly from user input—with no server-side validation, no session binding, and no privilege checks—any unauthenticated attacker can force CAPTCHA validation to be skipped.\n\nThere are no additional conditions, such as:\n\nno requirement for MFA\n\nno trusted device\n\nno IP reputation checks\n\nno prior valid session\n\nno rate limiting\n\nThis results in CAPTCHA being entirely client-controlled, which violates fundamental authentication and anti-automation security assumptions.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/1Panel-dev/1Panel"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "2.0.14"
32+
}
33+
]
34+
}
35+
]
36+
},
37+
{
38+
"package": {
39+
"ecosystem": "Go",
40+
"name": "github.com/1Panel-dev/1Panel/core"
41+
},
42+
"ranges": [
43+
{
44+
"type": "ECOSYSTEM",
45+
"events": [
46+
{
47+
"introduced": "0"
48+
},
49+
{
50+
"fixed": "0.0.0-20251128030527-ac43f00273be"
51+
}
52+
]
53+
}
54+
]
55+
}
56+
],
57+
"references": [
58+
{
59+
"type": "WEB",
60+
"url": "https://github.com/1Panel-dev/1Panel/security/advisories/GHSA-qmg5-v42x-qqhq"
61+
},
62+
{
63+
"type": "WEB",
64+
"url": "https://github.com/1Panel-dev/1Panel/commit/ac43f00273be745f8d04b90b6e2b9c1a40ef7bca"
65+
},
66+
{
67+
"type": "PACKAGE",
68+
"url": "https://github.com/1Panel-dev/1Panel"
69+
}
70+
],
71+
"database_specific": {
72+
"cwe_ids": [
73+
"CWE-290",
74+
"CWE-602",
75+
"CWE-807"
76+
],
77+
"severity": "HIGH",
78+
"github_reviewed": true,
79+
"github_reviewed_at": "2025-12-08T17:56:27Z",
80+
"nvd_published_at": null
81+
}
82+
}

0 commit comments

Comments
 (0)