Dataset Viewer
Auto-converted to Parquet Duplicate
fixed_code
stringclasses
3 values
root_cause
stringclasses
3 values
source_code
stringclasses
3 values
failure_stage
stringclasses
3 values
identity_flow
stringclasses
3 values
regression_test
stringclasses
3 values
security_impact
stringclasses
3 values
service_boundary
stringclasses
3 values
repair_explanation
stringclasses
3 values
authorization_check_point
stringclasses
3 values
tenant_isolation_analysis
stringclasses
3 values
router.post('/invoices/:invoiceId/cancel', requireUser, async (req, res, next) => { try { await billingClient.cancel(req.params.invoiceId, { authorization: req.get('authorization') }); return res.sendStatus(204); } catch (err) { return next(err); } }); // Billing service route; requireUser ...
The code confuses an identity claim supplied in an ordinary request header with a verified principal. The downstream handler trusts that claim and checks neither the user's cancellation permission nor the invoice's tenant association.
router.post('/invoices/:invoiceId/cancel', async (req, res, next) => { try { const userId = req.get('x-user-id'); await billingClient.cancel(req.params.invoiceId, { userId }); res.sendStatus(204); } catch (err) { next(err); } }); // Billing service handler async function cancelInvoice(invoiceId, ...
The failure begins at identity extraction: the public API treats a caller-controlled x-user-id header as an authenticated identity. It continues at the billing boundary, where the handler checks only for a non-empty value and performs no invoice-level authorization.
The caller supplies the x-user-id header to the invoice API. The API forwards that value as context.userId to the billing service. The billing handler does not independently authenticate the end user or verify that the identity is authorized for the invoice.
Verify that a request with a valid bearer credential for a user with invoice:cancel permission can cancel an open invoice in that user's tenant. Verify that a forged x-user-id header alone does not authenticate a request, that a user without the permission receives 403, and that an invoice belonging to another tenant i...
A caller may impersonate another user and attempt to cancel invoices outside their tenant or permission scope. This can cause unauthorized changes to billing records and cross-tenant integrity violations.
The public invoice API forwards cancellation requests to a billing service. The API reads an identity from an HTTP header, while the billing handler uses the forwarded identity only to check that a value is present before changing invoice state.
Authenticate the request before forwarding it, pass the original bearer credential to the billing service, and require the billing service to authenticate that credential independently. Before changing state, check both the user's cancellation permission and that the invoice belongs to the authenticated user's tenant.
The public API must authenticate the end-user request, and the billing service must verify the forwarded end-user credential and authorize the resulting identity against the invoice before calling invoices.markCancelled.
The invoice is loaded by ID without comparing its tenantId to the authenticated user's tenant. Consequently, a forged identity header combined with a known invoice identifier can bypass the intended tenant boundary if the billing service accepts the request.
router.patch('/documents/:documentId', requireUser, async (req, res, next) => { try { if (!req.user.permissions.includes('document:write')) { return res.sendStatus(403); } const updated = await documentStore.updateForTenant( req.params.documentId, req.user.tenantId, req.body )...
The handler assumes that possession of document:write grants access to every document. It fails to bind the permission check to the specific resource and authenticated user's tenant, then performs an update using only the caller-provided document ID.
router.patch('/documents/:documentId', requireUser, async (req, res, next) => { try { if (!req.user.permissions.includes('document:write')) { return res.sendStatus(403); } const updated = await documentStore.updateById(req.params.documentId, req.body); if (!updated) { return res.sendStatu...
The failure occurs at resource authorization and the downstream data call: a broad document:write permission is checked, but no tenant ownership check is applied before updateById changes the document.
The requireUser middleware attaches an authenticated user, including permissions and a tenantId, to req.user. The route checks the permission but does not use req.user.tenantId when selecting the document to update.
Verify that a user with document:write can update a document in their own tenant. Verify that a user without the permission receives 403. For a document ID belonging to another tenant, verify that the tenant-scoped update returns no record, the API responds with 404, and the document remains unchanged.
A user with a tenant-scoped writing role may modify documents owned by another tenant. This creates a cross-tenant integrity risk and may allow unauthorized changes to sensitive records.
The document API authenticates users and checks a document:write permission before asking the document store to update a document. The store operation is keyed only by document ID.
Retain the permission check, then perform the update with both the requested document ID and the authenticated tenant ID as query constraints. Treat a non-matching record as not found so the handler does not disclose or modify another tenant's document.
The route's permission check must be combined with a tenant-scoped document lookup or update. The document store should only update a record matching both req.params.documentId and req.user.tenantId.
The authenticated tenant is available on req.user but is omitted from the store query. If document identifiers can refer to records in other tenants, a user with document:write can update a cross-tenant document.
router.get('/tenants/:tenantId/reports/export', requireUser, async (req, res, next) => { try { const tenantId = req.params.tenantId; const isMember = await membershipStore.hasTenant(req.user.id, tenantId); if (!isMember) { return res.sendStatus(403); } const report = await reportStore.expor...
The route treats a caller-controlled path parameter as sufficient authority to select a tenant. Authentication alone does not establish access to every tenant, and no membership or tenant-scope check occurs before data retrieval.
router.get('/tenants/:tenantId/reports/export', requireUser, async (req, res, next) => { try { const report = await reportStore.exportForTenant(req.params.tenantId); res.json(report); } catch (err) { next(err); } });
The failure occurs during authorization: authentication establishes a user identity, but the handler makes the downstream data call without verifying that the user belongs to the requested tenant.
The requireUser middleware authenticates the request and attaches the user identity to req.user. The route then takes tenantId directly from the URL and passes it to reportStore.exportForTenant; no check connects that tenant identifier to the authenticated user.
Verify that an authenticated user who belongs to the requested tenant receives that tenant's report. Verify that a user with no membership in the requested tenant receives 403 and that reportStore.exportForTenant is not called. Also verify that unauthenticated requests are rejected by requireUser.
An authenticated user may obtain report data belonging to a tenant they are not authorized to access. The impact is cross-tenant disclosure of exported reporting data.
An authenticated request enters the reporting API. The route reads a tenant identifier from the URL and calls the report store, which retrieves tenant-scoped export data.
Check the authenticated user's membership in the requested tenant before invoking the report store. Deny the request when membership is absent, and use the same validated tenant identifier for the data access.
The route handler should authorize access to req.params.tenantId after requireUser has populated req.user and before calling reportStore.exportForTenant.
The requested tenant is passed unchanged to the data store, with no check against the authenticated user's tenant memberships. If the store returns data for any supplied tenant identifier, an authenticated user can request another tenant's export.

Microservice Authorization Boundary Debugging and Root-Cause Analysis Dataset

This dataset contains microservice source-code cases involving flaws in identity propagation, permission checks, and tenant-isolation boundaries, with supporting details on service boundaries, identity flows, failure stages, and root causes. Each case also includes security impact, a repair explanation, fixed code, and regression test guidance for cloud-native application security reviews and authorization troubleshooting. It supports code SFT by helping models reason from source code and call chains to locate authorization failures and propose fixes.

Technical Specifications

Field Type Description
fixed_code string A corrected code snippet addressing the flaw in the source code.
root_cause string Explains the code logic, trust assumption, or omitted check that caused the authorization boundary to fail.
source_code string A microservice source-code snippet containing an authorization boundary flaw, provided as the input for analysis.
failure_stage string Specifies whether the failure occurs during identity extraction, identity propagation, permission evaluation, or a downstream call.
identity_flow string Describes how an identity or credential travels from the request entry point through the call chain to the permission check.
regression_test string Describes test scenarios for validating the fix and the expected authorization or tenant-isolation outcomes.
security_impact string Describes potential consequences such as unauthorized access, privilege escalation, or cross-tenant data exposure.
service_boundary string Describes the relevant service, interface, or component boundaries and their roles in the call chain.
repair_explanation string Explains how the fix strengthens identity propagation, permission validation, or tenant boundary checks.
authorization_check_point string Identifies the function, call site, or code stage where an authorization check should occur or currently occurs.
tenant_isolation_analysis string Explains whether the flaw enables cross-tenant access and how tenant identifiers are handled during validation and data access.

Compliance Statement

Authorization TypeCC-BY-NC-SA 4.0 (Attribution–NonCommercial–ShareAlike)
Commercial UseRequires exclusive subscription or authorization contract (monthly or per-invocation charging)
Privacy and AnonymizationNo PII, no real company names, simulated scenarios follow industry standards
Compliance SystemCompliant with China's Data Security Law / EU GDPR / supports enterprise data access logs

Source & Contact

contact@mobiusi.com

Downloads last month
-