evidence stringclasses 3
values | source_code stringclasses 3
values | expected_boundary stringclasses 3
values | violation_category stringclasses 3
values | boundary_compliance bool 2
classes | programming_language stringclasses 1
value | tenant_identity_source stringclasses 3
values | authorization_mechanism stringclasses 3
values | cross_tenant_data_access bool 2
classes | observed_authorization_decision stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|
After the userId check, the database lookup filters only by report ID. The code does not compare the report's tenant with any tenant associated with the caller, so a caller who knows another tenant's report ID can receive that report. | async function downloadReport(req, res) {
if (!req.auth?.userId) {
return res.status(401).end();
}
const report = await db.report.findUnique({
where: { id: req.params.reportId }
});
if (!report) return res.status(404).end();
return res.json(report);
} | An authenticated caller may retrieve a report only if the report belongs to the caller's tenant. | 资源租户归属校验缺失 | false | JavaScript | The request context is checked for req.auth.userId, but no tenant identity is read; the report record is retrieved by its ID. | The handler checks that a user is authenticated, then retrieves a report by ID without checking its tenant ownership. | true | 允许 |
The handler accepts any string in req.query.tenantId and uses it directly in the database filter. It never checks that this value matches an authenticated tenant identity, so an authenticated caller can request events for another tenant. | async function listEvents(req, res) {
if (!req.auth?.userId) {
return res.status(401).end();
}
const tenantId = req.query.tenantId;
if (typeof tenantId !== "string") {
return res.status(400).end();
}
const events = await db.event.findMany({
where: { tenantId }
});
return res.json(events);
... | The tenant filter must be derived from or verified against the authenticated caller's tenant identity; callers must not select another tenant's data by changing a request parameter. | 租户身份校验缺失 | false | JavaScript | The tenant ID used for the query comes directly from the caller-controlled req.query.tenantId parameter; the authenticated request context is checked only for userId. | The handler requires an authenticated user and filters events using the tenant ID supplied in the query string, without comparing it to the caller's tenant. | true | 允许 |
The lookup filters by both req.params.invoiceId and the request-context tenantId. A missing tenant ID is rejected, and no invoice outside that tenant can match this query. | async function getInvoice(req, res) {
// req.auth is populated by authentication middleware.
const tenantId = req.auth?.tenantId;
if (typeof tenantId !== "string" || tenantId.length === 0) {
return res.status(401).end();
}
const invoice = await db.invoice.findFirst({
where: { id: req.params.invoiceId... | A caller may retrieve an invoice only when it belongs to the tenant in the authenticated request context. | 无违规 | true | JavaScript | The tenant ID in the authenticated request context, read from req.auth.tenantId. | The handler requires a tenant ID and includes it in the database lookup alongside the invoice ID. | false | 允许 |
Multi-Tenant Authorization Code Verification Dataset
This dataset contains source code snippets from cloud-native applications involving tenant identity validation, resource access control, and cross-tenant data access. The examples are labeled to indicate whether observed authorization behavior complies with the expected tenant-isolation and access boundaries, with structured details such as programming language, identity source, authorization mechanism, violation category, and supporting evidence. It is suitable for code verification training, multi-tenant security assessment, authorization flaw detection, and cloud-native security research.
Technical Specifications
| Field | Type | Description |
|---|---|---|
| evidence | string | Key code logic or a concise analysis supporting the authorization behavior and boundary-compliance conclusion. |
| source_code | string | Cloud-native application source code to be evaluated for authorization behavior. |
| expected_boundary | string | Tenant-isolation or resource-access rule that the code is expected to enforce. |
| violation_category | string | Classification of an authorization-boundary issue in the code, including the appropriate category when there is no violation or the result cannot be determined. |
| boundary_compliance | boolean | Whether the code meets the expected authorization boundary: true if compliant and false if non-compliant. |
| programming_language | string | Programming language identified from the source code. |
| tenant_identity_source | string | Source used by the code to obtain or validate the current tenant identity, such as a token claim, request context, or database record. |
| authorization_mechanism | string | Primary mechanism used by the code to determine whether a user or service may access a target resource. |
| cross_tenant_data_access | boolean | Whether the code may allow access to data belonging to another tenant. |
| observed_authorization_decision | string | Access behavior determined from the code logic. |
Compliance Statement
| Authorization Type | CC-BY-NC-SA 4.0 (Attribution–NonCommercial–ShareAlike) |
| Commercial Use | Requires exclusive subscription or authorization contract (monthly or per-invocation charging) |
| Privacy and Anonymization | No PII, no real company names, simulated scenarios follow industry standards |
| Compliance System | Compliant with China's Data Security Law / EU GDPR / supports enterprise data access logs |
Source & Contact
- Downloads last month
- 17