CVE-2026-48788 — Vulnerability in github.com/umputun/remark42
Remark42: Cross-Site Scripting (XSS) on /api/v1/img via content-type spoofing
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.41%). Schedule for your next planned update.
Does your project use an affected github.com/umputun/remark42 version?
Paste your go.sum to check it for CVE-2026-48788 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
The remark42 image proxy fetches an arbitrary remote URL and re-serves the response from remark42's own origin. The download path decides whether the fetched resource is an image by looking only at the Content-Type header the remote server claims — it never inspects the actual bytes. The serving path then derives the response Content-Type by sniffing those bytes with http.DetectContentType.
An attacker hosts a URL that sets Content-Type to image/png but returns an HTML/JavaScript body:
- the download check sees
image/png→ accepts it; - the serve path sniffs the body → emits
Content-Type: text/html; - the browser renders attacker HTML/JS as a document in remark42's origin.
Details
Downloader
backend/app/rest/proxy/image.go — downloadImage(), lines 189-206:
contentType := resp.Header.Get("Content-Type")
if !strings.HasPrefix(contentType, "image/") {
return nil, fmt.Errorf("invalid content type %s", contentType)
}
maxSize := 5 * 1024 * 1024 // 5MB default
if p.ImageService != nil && p.ImageService.MaxSize > 0 {
maxSize = p.ImageService.MaxSize
}
lr := io.LimitReader(resp.Body, int64(maxSize)+1)
imgData, err := io.ReadAll(lr)
if err != nil {
return nil, fmt.Errorf("unable to read image body: %w", err)
}
if len(imgData) > maxSize {
return nil, fmt.Errorf("image is too large")
}
return imgData, nil // <-- bytes never validated, returned as-is
Send Content-Type: image/png and the check passes regardless of what the body actually contains.
Server
backend/app/rest/proxy/image.go — Handler(), line 131:
w.Header().Add("Content-Type", p.ImageService.ImgContentType(img))
_, err = io.Copy(w, bytes.NewReader(img))
backend/app/store/image/image.go — ImgContentType(), lines 242-249:
func (s *Service) ImgContentType(img []byte) string {
contentType := http.DetectContentType(img)
if contentType == "application/octet-stream" {
return "image/*"
}
return contentType // <-- returns text/html for an HTML body
}
PoC
self.send_response(200)
self.send_header("Content-Type", "image/png")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body) # body = <!DOCTYPE html><script>...</script>
Then have the victim open https://<remark42-host>/api/v1/img?src=<base64(attacker-host)> top-level.
Impact
- The script can issue authenticated, same-origin API calls with
credentials: 'include'— the JWT cookie is sent automatically. - The script can read the
XSRF-TOKENcookie and re-send it as theX-XSRF-TOKENheader, defeating CSRF protection. The attacker acts as the victim: delete/edit their comments, change their settings, and — if the victim is admin — perform admin actions.
Triggering requires no remark42 account on the target instance; the attacker only needs to host the malicious upstream URL and deliver the proxy link to a victim by any means (email, DM, link on another site, etc.).
Fix
v1.16.0 adds layered defense to /api/v1/img and /api/v1/picture/{user}/{id}:
rest.SafeImgContentTypevalidates sniffed body bytes against a strict allowlist (image/png,image/jpeg,image/gif,image/webp,image/bmp,image/x-icon). Non-image content returns415with no body echo. SVG is implicitly excluded.- Every response carries
Content-Security-Policy: default-src 'none'; sandbox; frame-ancestors 'none',X-Content-Type Options: nosniff, andContent-Disposition: inline; filename="image". - The ETag is bumped to
"v2:<base64(src)>". Browsers that revalidate cached pre-fix responses get a fresh validated200instead of a304against the poisoned cached entry. - The strict
default-src 'none'; sandboxCSP also applies to all/api/v1/*routes as defense-in-depth.
Residual exposure
Browser-local caches that already hold a pre-fix text/html response with Cache-Control: max-age=2592000 keep serving it from local store until the TTL expires or the cache is evicted under memory pressure. The ETag bump only reaches clients that revalidate during the cached lifetime. Operators running a CDN/edge cache in front of remark42 should purge /api/v1/img after deploying v1.16.0.
Advisory Timeline
- First published June 26, 2026 (153 days ago).
- Last revised July 7, 2026 — 11 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get github.com/umputun/remark42@v1.16.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Go (1).
| Package | Fixed In |
|---|---|
| github.com/umputun/remark42 Go · Affected: All versions | 1.16.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-436
- CWE-79Cross-site Scripting (XSS)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.2 score means for each attack dimension.
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
References
- https://github.com/umputun/remark42/security/advisories/GHSA-4c8j-mgm4-qqvpWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-48788ADVISORY
- https://github.com/umputun/remark42/commit/78d6de6bce1e961f023969da3ec8a00dd80c9ae8WEB
- https://github.com/umputun/remark42PACKAGE
- https://github.com/umputun/remark42/releases/tag/v1.16.0WEB
Frequently Asked Questions
- What is CVE-2026-48788?
- Remark42: Cross-Site Scripting (XSS) on /api/v1/img via content-type spoofing. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.2/10).
- How do I check if my project is affected by CVE-2026-48788?
- CVE-2026-48788 affects github.com/umputun/remark42. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-48788 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 26.5% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-108262HIGH
DDEV incomplete tar symlink traversal fix allows host file overwrite - Incomplete fix of CVE-2026-32885
- CVE-2026-130007HIGH
k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution