GHSA-g9xj-752q-xh63 CVE-2026-33679 GO-2026-4852
Vikjuna Bypasses Webhook SSRF Protections During OpenID Connect Avatar Download
- Severity
- 6.4 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.40%
- Chance of exploitation in the next 30 days. Higher than 34.48% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-918 Server-Side Request Forgery (SSRF)
- Fix
2.2.1- Upgrade code.vikunja.io/api to this version or later
Description
Summary
The DownloadImage function in pkg/utils/avatar.go uses a bare http.Client{} with no SSRF protection when downloading user avatar images from the OpenID Connect picture claim URL. An attacker who controls their OIDC profile picture URL can force the Vikunja server to make HTTP GET requests to arbitrary internal or cloud metadata endpoints. This bypasses the SSRF protections that are correctly applied to the webhook system.
Details
When a user authenticates via OpenID Connect, Vikunja extracts the picture claim from the ID token or UserInfo endpoint and passes it to syncUserAvatarFromOpenID, which calls utils.DownloadImage with the attacker-controlled URL:
Claim extraction (pkg/modules/auth/openid/openid.go:70-78):
type claims struct {
Email string `json:"email"`
Name string `json:"name"`
PreferredUsername string `json:"preferred_username"`
Nickname string `json:"nickname"`
VikunjaGroups []map[string]interface{} `json:"vikunja_groups"`
Picture string `json:"picture"`
// ...
}
Avatar sync trigger (pkg/modules/auth/openid/openid.go:348-352):
// Try sync avatar if available
err = syncUserAvatarFromOpenID(s, u, cl.Picture)
if err != nil {
log.Errorf("Error syncing avatar for user %s: %v", u.Username, err)
}
Vulnerable download (pkg/utils/avatar.go:94-115):
func DownloadImage(url string) ([]byte, error) {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
if err != nil {
return nil, fmt.Errorf("failed to create HTTP request: %w", err)
}
resp, err := (&http.Client{}).Do(req) // No SSRF protection
// ...
return io.ReadAll(resp.Body) // No size limit
}
In contrast, the webhook system correctly applies SSRF protection (pkg/models/webhooks.go:306-310):
if !config.WebhooksAllowNonRoutableIPs.GetBool() {
guardian := ssrf.New(ssrf.WithAnyPort())
transport.DialContext = (&net.Dialer{
Control: guardian.Safe,
}).DialContext
}
The avatar download path has none of this protection. There is no URL scheme validation, no IP address filtering, and no response body size limit.
PoC
Prerequisites: A Vikunja instance with OpenID Connect configured (e.g., Keycloak, Authentik). Attacker has an account on the OIDC provider.
Step 1: Set up a listener to observe incoming requests:
# On attacker-controlled server or internal service
nc -lvp 8888
Step 2: In the OIDC provider (e.g., Keycloak admin), update the attacker's user profile picture URL to an internal address:
http://169.254.169.254/latest/meta-data/iam/security-credentials/
Or to probe internal services:
http://internal-service:8888/admin
Step 3: Log in to Vikunja via the OIDC provider. After the callback completes, the Vikunja server will make a GET request from its own network context to the URL set in the picture claim.
Step 4: Observe the request arriving at the internal endpoint or listener. The request originates from the Vikunja server's IP, bypassing any network-level access controls that allow Vikunja server traffic.
Cloud metadata example (AWS):
# Set picture URL to:
http://169.254.169.254/latest/meta-data/iam/security-credentials/
# Vikunja server makes GET to this URL from its own network context
# The response is read into memory (io.ReadAll) before image.Decode fails
# The HTTP request itself reaches the metadata service
Impact
- Cloud metadata access: Attacker can reach cloud instance metadata services (AWS IMDSv1 at
169.254.169.254, GCP, Azure equivalents) from the Vikunja server's network position, potentially leaking IAM credentials, instance identity tokens, and configuration data. - Internal network reconnaissance: Port scanning and service discovery of internal hosts reachable from the Vikunja server by observing response timing and error messages.
- Internal service interaction: Any internal service that acts on GET requests (cache purges, status endpoints, admin panels) can be triggered.
- Memory pressure: The
io.ReadAllcall with no size limit means pointing the URL at a large resource could cause memory exhaustion on the Vikunja server, though the 3-second timeout partially mitigates this. - Repeated exploitation: The SSRF triggers on every OIDC login, allowing the attacker to iterate through different internal URLs by updating their OIDC profile between logins.
Recommended Fix
Apply the same SSRF protection used in webhooks to DownloadImage, and add a response body size limit:
// pkg/utils/avatar.go
import (
"net"
"code.dny.dev/ssrf"
)
func DownloadImage(url string) ([]byte, error) {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
if err != nil {
return nil, fmt.Errorf("failed to create HTTP request: %w", err)
}
// SSRF protection: block requests to non-globally-routable IPs
guardian := ssrf.New(ssrf.WithAnyPort())
client := &http.Client{
Transport: &http.Transport{
DialContext: (&net.Dialer{
Control: guardian.Safe,
}).DialContext,
},
}
resp, err := client.Do(req)
if err != nil {
return nil, fmt.Errorf("failed to download image: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to download image, status code: %d", resp.StatusCode)
}
// Limit response body to 10MB to prevent memory exhaustion
const maxAvatarSize = 10 * 1024 * 1024
return io.ReadAll(io.LimitReader(resp.Body, maxAvatarSize))
}
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| code.vikunja.io/api | < 2.2.1 |
2.2.1 |
| code.vikunja.io/api | all versions |
No fix yet |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
code.vikunja.io/api Go → 2.2.1
- go
go get code.vikunja.io/api@v2.2.1 && go mod tidy
Severity breakdown
CVSS 3.1 6.4
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:L
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Changed
- Confidentiality
- Low
- Integrity
- None
- Availability
- Low
Weakness
CWE-918: Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-m687-p538-r5hp Vikunja: Permissive Cross-domain Security Policy trusts every localhost origin which should not be trusted | Medium | Also affects code.vikunja.io/api |
| GHSA-fmmf-xq98-g327 Vikunja: Write-level project members can delete admin-tier link shares through an unloaded permission check | Medium | Also affects code.vikunja.io/api |
| GHSA-pjr3-86v4-5p7w Vikunja: Explicit lower-permission share on a sub-project is silently overridden by an inherited parent permission (broken access control / privilege-management regression in v2.6.0) | Medium | Also affects code.vikunja.io/api |
| GHSA-hjx8-qv73-f7cm Vikunja: Webhooks and link shares survive every revocation path, so a removed collaborator keeps a live feed | High | Also affects code.vikunja.io/api |
| GHSA-fprf-r6rv-xg99 Vikunja: Saved filter creation with an empty filter string recalculates task positions across all tenants | Medium | Also affects code.vikunja.io/api |
| GHSA-4hv6-xc92-j86g Vikunja: WebSocket authentication ignores server-side session state, so revoked sessions keep receiving live pushes | High | Also affects code.vikunja.io/api |
| GHSA-w2ch-4xgr-22ww Vikunja: Task relation deletion does not check read access to the other task, allowing cross-project relation removal | Low | Also affects code.vikunja.io/api |
| GHSA-8wvg-r2j4-3737 Vikunja: Assignee email addresses disclosed to read-only project members via the task assignees endpoint | Medium | Also affects code.vikunja.io/api |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor