<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alec Chappell on Medium]]></title>
        <description><![CDATA[Stories by Alec Chappell on Medium]]></description>
        <link>https://medium.com/@alecclyde?source=rss-b54ebf044dd6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oTm6bHjdbuKv2Ii6GkIoNw.png</url>
            <title>Stories by Alec Chappell on Medium</title>
            <link>https://medium.com/@alecclyde?source=rss-b54ebf044dd6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:30:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alecclyde/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Finding CVE-2026-40103 in Vikunja: Scoped API Token Authorization Mismatch]]></title>
            <link>https://medium.com/@alecclyde/finding-cve-2026-40103-in-vikunja-scoped-api-token-authorization-mismatch-2af53cb6bea5?source=rss-b54ebf044dd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2af53cb6bea5</guid>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Alec Chappell]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 20:34:03 GMT</pubDate>
            <atom:updated>2026-04-13T20:46:17.272Z</atom:updated>
            <content:encoded><![CDATA[<h3>Finding CVE-2026–40103 in Vikunja: a scoped API token authorization mismatch</h3><p>In <strong>April 2026</strong>, I reported a scoped API token authorization issue in <a href="https://github.com/go-vikunja/vikunja">Vikunja</a>, the open-source task and project management platform. The public GitHub advisory is <a href="https://github.com/go-vikunja/vikunja/security/advisories/GHSA-v479-vf79-mg83">GHSA-v479-vf79-mg83</a>, GitHub assigned CVE-2026-40103, and the advisory lists patched version 2.3.0.</p><p>This was not an unauthenticated issue, and it was not a full privilege escalation beyond the token owner’s existing project rights. The affected token still had to be created by a user who could already update the target project. But it was still a real security boundary break inside Vikunja’s scoped token model: a token granted projects.background could successfully delete a project background, while a token granted the apparently more specific projects.background_delete scope was rejected.</p><p>That mismatch matters because scoped tokens exist to narrow delegated access for integrations and automation. If the token model says “this token can read background state” but the runtime path lets it delete background state, the least-privilege boundary is no longer reliable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*BUlzxcN356tLdaR7.png" /></figure><h3>Background</h3><p>Vikunja lets users create API tokens with explicit scoped permissions. The token model is documented directly in the code and API flow: available token permissions are exposed via /api/v1/routes, token creation validates requested permissions against that route inventory, and request-time authorization checks whether the presented token can use the current route.</p><p>That design is sensible. If it works correctly, it gives users a way to issue narrower credentials to scripts, integrations, and automation without handing those systems the full power of a normal user session.</p><p>That also means the token scope layer is a real security boundary. A scoped token does not need to grant more power than the full user account to create a security issue. If it can perform an action outside its declared scope, the delegated credential model is broken.</p><h3>What I Validated</h3><p>I kept the finding narrow and validated only one concrete route family:</p><ul><li><strong>GET</strong> /api/v1/projects/:project/background</li><li><strong>DELETE </strong>/api/v1/projects/:project/background</li></ul><p>On the commit I reviewed, Vikunja exposed two distinct token permissions for those routes:</p><ul><li>projects.<strong>background</strong></li><li>projects.<strong>background_delete</strong></li></ul><p>But the runtime authorization decision did not line up with that inventory.</p><p>In the validated case:</p><ul><li>a token with only {&quot;projects&quot;:[&quot;background&quot;]} could <strong>successfully</strong> call DELETE /api/v1/projects/:project/background</li><li>a token with only {&quot;projects&quot;:[&quot;background_delete&quot;]} was <strong>rejected </strong>with 401 Unauthorized</li></ul><p>That is the full public claim in this writeup. The same bug class may affect additional routes, but I am intentionally keeping this post limited to the background case because that is the case I independently validated end to end.</p><h3>Why I Considered This a Security Issue</h3><p>The obvious pushback is: if the token owner already has project update rights, is this really security-relevant?</p><p>I think the answer is yes, but only within the right lense.</p><p>This is not a cross-user takeover or an unauthenticated flaw. The token owner still needs enough underlying project access that the delete handler would accept the action. But Vikunja’s scoped API tokens are supposed to reduce what delegated credentials can do relative to the full user account. Breaking that guarantee weakens the security model for:</p><ul><li>external integrations</li><li>CI or automation jobs</li><li>scripts handed narrow credentials</li><li>any environment where a token is intentionally safer to expose than a full session or a broader token</li></ul><p>That makes this a moderate authorization and integrity issue, not a critical platform compromise.</p><h3>How The Bug Worked</h3><p>The issue was a mismatch between how Vikunja registered token-usable routes and how it later mapped live requests back to token permissions.</p><h3>Step 1: route registration created two distinct permission names</h3><p>For custom parent subroutes, Vikunja’s CollectRoutesForAPITokenUsage() logic groups routes under a parent resource and uses the remaining path segments as the child permission name.</p><p>For the project background routes:</p><ul><li>GET /api/v1/projects/:project/<strong>background </strong>became <strong>projects.background</strong></li><li>DELETE /api/v1/projects/:project/<strong>background </strong>collided with that same child key and was renamed projects.<strong>background_delete</strong></li></ul><p>That part is visible in the registration logic and is also reflected in /api/v1/routes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*lgXL1Ck8IsqOfdwX.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/0*3U_DQhuLEJtxVd_Q.png" /></figure><h3>Step 2: token creation accepted both permissions</h3><p>Vikunja validates requested token permissions against the collected route inventory. Because both background and background_delete existed in that inventory, both permission sets were considered valid token scopes at creation time.</p><p>That means the bug was not a token-creation validation failure. <strong>The token model itself believed both permissions existed and were distinct.</strong></p><h3>Step 3: runtime authorization reconstructed the wrong permission</h3><p>At request time, CanDoAPIRoute() tries to map the current request back to a token permission. For the custom parent-subroute fallback path, it rebuilds the child key from the request path:</p><pre>route = strings.Join(routeParts[1:], &quot;_&quot;)</pre><p>For DELETE /api/v1/projects/:project/background, that fallback reconstructs only:</p><pre>background</pre><p>It does not re-apply the HTTP method suffix that was added during registration. In the fallback branch, it also authorizes by direct string equality on that reconstructed child key rather than by matching both path and method against the stored RouteDetail.</p><p>So the runtime authorization logic <strong>accepts</strong>:</p><ul><li>projects.<strong>background</strong></li></ul><p>and <strong>rejects</strong>:</p><ul><li>projects.<strong>background_delete</strong></li></ul><p>for the exact same DELETE request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aVdUNtkm1-tKJLeG.png" /></figure><h3>Step 4: middleware trusted that wrong decision</h3><p>The token middleware calls CanDoAPIRoute() before handing the request to the actual route handler.</p><p>If CanDoAPIRoute() returns true, the token is accepted as authorized for that route.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e_cK7X3SFp44UJK0.png" /></figure><h3>Step 5: the delete handler reached a real state-changing path</h3><p>This matters because the background delete route is not a harmless metadata endpoint.</p><p>RemoveProjectBackground():</p><ul><li>checks write rights via project.CanUpdate(...)</li><li>invokes DeleteBackgroundFileIfExists()</li><li>calls ClearProjectBackground(), which clears the project&#39;s background_file_id and background_blur_hash</li></ul><p>So once the token gate makes the wrong authorization decision, the request reaches a genuine state-changing handler and clears the project’s background linkage fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F7u1MemvTaV-KWcD.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4PlISreBZe6zM_4r.png" /></figure><h3>Reproduction In Short</h3><p>The product-level reproduction is simple. The only small environment note is that Vikunja registers these project background routes only when backgrounds.enabled is on. In the reviewed commit, that setting defaults to true, which matched my validation environment.</p><ol><li>Start with a user who can update a project that already has a background.</li><li>Create an API token with only:</li></ol><pre>{&quot;projects&quot;:[&quot;background&quot;]}</pre><ol><li>Send:</li></ol><pre>DELETE /api/v1/projects/&lt;project_id&gt;/background<br>Authorization: Bearer &lt;token&gt;</pre><ol><li>Observe that the request succeeds and the project background is removed.</li></ol><p>For comparison, create a token with only:</p><pre>{&quot;projects&quot;:[&quot;background_delete&quot;]}</pre><p>and repeat the same request. In the validated case, that token was <strong>rejected</strong>.</p><h3>Impact And Limits</h3><p>I would describe the impact conservatively. Maybe <strong>low </strong>to <strong>medium</strong> (CVSS says <strong>4.3</strong>):</p><ul><li>real authorization bug: <strong>yes</strong></li><li>integrity impact: <strong>yes</strong></li><li>unauthenticated or cross-tenant compromise: <strong>no</strong></li><li>complete privilege escalation beyond the token owner’s underlying project rights: <strong>no</strong></li></ul><p>The issue weakens the trust model around delegated credentials. A token that appears limited to one capability is able to perform another capability, and the more specific delete permission does not behave as expected.</p><p>At the same time, the prerequisites keep the severity lower:</p><ul><li>the attacker needs a valid API token</li><li>the token must belong to a user who already has enough underlying rights that the handler’s CanUpdate check passes</li><li>the validated impact is limited to project background deletion in the public claim here</li></ul><h3>A Note On Bug-Class Scope</h3><p>One nuance is worth calling out.</p><p>This is not “every multi-method route in Vikunja is vulnerable.” Standard CRUD routes are handled differently and still compare both path and method in the normal authorization branch. The risky area is narrower: custom non-CRUD subroutes that are collected under a parent permission group and later authorized through the fallback child-key reconstruction path.</p><p>That narrower framing is one reason I felt comfortable reporting the background case specifically instead of making a broad public claim about the entire route tree.</p><h3>Disclosure Timeline</h3><ul><li>2026–04–08: I reported the issue through Vikunja’s GitHub private advisory flow.</li><li>2026–04–09: The maintainer accepted the advisory and noted that the same bug class likely affects additional routes.</li><li>2026–04–09: The advisory was published publicly as GHSA-v479-vf79-mg83.</li><li>2026–04–10: GitHub assigned CVE-2026-40103.</li><li>2026–04–13: I verified the public advisory lists patched version 2.3.0.</li></ul><p>The maintainer was very responsive and communicative throughout the disclosure process. If the maintainer later publishes a broader advisory or splits additional variants into a separate record, that would be the right place to describe the wider class. This writeup stays intentionally narrower than that.</p><h3>Takeaways</h3><p>The main lesson here is simple: if a permission system defines permissions one way, it needs to enforce them the same way.</p><p>In this case, Vikunja created separate permission names while registering routes, but the fallback authorization logic later rebuilt permissions using only the request path. That mismatch let a scoped token perform a stronger action than its declared scope suggested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RIPlpAp1iGGyIdBwiQGlVg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2af53cb6bea5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>