Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹 Go

GHSA-8rf9-c59g-f82f

MEDIUM

WeKnora has Unauthorized Cross‑Tenant Knowledge Base Cloning

Also known asCVE-2026-30857GO-2026-4640
Published
Mar 6, 2026
Updated
Mar 23, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk13th percentile+0.18%
0.00%0.24%0.48%0.72%0.0%0.0%0.0%0.2%Apr 26Jun 26Jun 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Blast Radius

1 pkg affected
🐹github.com/Tencent/WeKnora

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A cross-tenant authorization bypass in the knowledge base copy endpoint allows any authenticated user to clone (duplicate) another tenant’s knowledge base into their own tenant by knowing/guessing the source knowledge base ID. This enables bulk data exfiltration (document/FAQ content) across tenants, making the impact critical.

Details

The POST /api/v1/knowledge-bases/copy endpoint enqueues an asynchronous KB clone task using the caller-supplied source_id without verifying ownership (see internal/handler/knowledgebase.go).

// Create KB clone payload
payload := types.KBClonePayload{
  TenantID: tenantID.(uint64),
  TaskID:   taskID,
  SourceID: req.SourceID, // from attacker's input
  TargetID: req.TargetID,
}

payloadBytes, err := json.Marshal(payload)
if err != nil {
  logger.Errorf(ctx, "Failed to marshal KB clone payload: %v", err)
  c.Error(errors.NewInternalServerError("Failed to create task"))
  return
}

// Enqueue KB clone task to Asynq
task := asynq.NewTask(types.TypeKBClone, payloadBytes,
asynq.TaskID(taskID), asynq.Queue("default"), asynq.MaxRetry(3)) // enqueue task
info, err := h.asynqClient.Enqueue(task)
if err != nil {
  logger.Errorf(ctx, "Failed to enqueue KB clone task: %v", err)
  c.Error(errors.NewInternalServerError("Failed to enqueue task"))
  return
}

Then, the asynq task handler (ProcessKBClone) invokes the CopyKnowledgeBase service method to perform the clone operation (see internal/application/service/knowledge.go):

// Get source and target knowledge bases
srcKB, dstKB, err := s.kbService.CopyKnowledgeBase(ctx, payload.SourceID, payload.TargetID)
if err != nil {
    logger.Errorf(ctx, "Failed to copy knowledge base: %v", err)
    handleError(progress, err, "Failed to copy knowledge base configuration")
    return err
}

After that, the CopyKnowledgeBase method calls the repository method to load the source knowledge base (see internal/application/service/knowledgebase.go):

func (s *knowledgeBaseService) CopyKnowledgeBase(ctx context.Context,
	srcKB string, dstKB string,
) (*types.KnowledgeBase, *types.KnowledgeBase, error) {
	sourceKB, err := s.repo.GetKnowledgeBaseByID(ctx, srcKB)
	if err != nil {
		logger.Errorf(ctx, "Get source knowledge base failed: %v", err)
		return nil, nil, err
	}
	sourceKB.EnsureDefaults()
	tenantID := ctx.Value(types.TenantIDContextKey).(uint64)
	var targetKB *types.KnowledgeBase
	if dstKB != "" {
		targetKB, err = s.repo.GetKnowledgeBaseByID(ctx, dstKB)
        // ...
    }
    // ...
}

Note: until now, the tenant ID is correctly set in context to the attacker’s tenant (from the payload), which can be used to prevent cross-tenant access.

However, the repository method GetKnowledgeBaseByID loads knowledge bases by id only, allowing cross-tenant reads (see internal/application/repository/knowledgebase.go).

func (r *knowledgeBaseRepository) GetKnowledgeBaseByID(ctx context.Context, id string) (*types.KnowledgeBase, error) {
	var kb types.KnowledgeBase
	if err := r.db.WithContext(ctx).Where("id = ?", id).First(&kb).Error; err != nil {
		if errors.Is(err, gorm.ErrRecordNotFound) {
			return nil, ErrKnowledgeBaseNotFound
		}
		return nil, err
	}
	return &kb, nil
}

The data access layer fails to enforce tenant isolation because GetKnowledgeBaseByID only filters by ID and ignores the tenant_id present in the context. A secure implementation should enforce a tenant-scoped lookup (e.g., WHERE id = ? AND tenant_id = ?) or use a tenant-aware repository API to prevent cross-tenant access.

Service shallow-copies the KB configuration by calling GetKnowledgeBaseByID(ctx, srcKB) for the source KB, then creates a new KB under the attacker’s tenant while copying fields from the victim KB (internal/application/service/knowledgebase.go):

sourceKB, err := s.repo.GetKnowledgeBaseByID(ctx, srcKB) // not tenant-scoped
...
targetKB = &types.KnowledgeBase{
    ID:                    uuid.New().String(),
    Name:                  sourceKB.Name,
    Type:                  sourceKB.Type,
    Description:           sourceKB.Description,
    TenantID:              tenantID,
    ChunkingConfig:        sourceKB.ChunkingConfig,
    ImageProcessingConfig: sourceKB.ImageProcessingConfig,
    EmbeddingModelID:      sourceKB.EmbeddingModelID,
    SummaryModelID:        sourceKB.SummaryModelID,
    VLMConfig:             sourceKB.VLMConfig,
    StorageConfig:         sourceKB.StorageConfig,
    FAQConfig:             faqConfig,
}
targetKB.EnsureDefaults()
  if err := s.repo.CreateKnowledgeBase(ctx, targetKB); err != nil {
      return nil, nil, err
  }
}

PoC

Precondition: Attacker is authenticated in Tenant A and can obtain (or guess) a victim's knowledge base UUID belonging to Tenant B.

  1. Authenticate as Tenant A and obtain a bearer token or API key.

  2. Start a cross-tenant clone using the victim’s knowledge base ID as source_id:

curl -X POST http://localhost:8088/api/v1/knowledge-bases/copy \
  -H "Authorization: Bearer <ATTACKER_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"source_id":"<VICTIM_KB_UUID>","target_id":""}'
  1. Observe that the task is accepted:
  • HTTP 200 OK
  • Response contains a task_id and a message like "Knowledge base copy task started".
  1. After the async task completes, a new knowledge base appears under Tenant A containing copied content/config from Tenant B.

Note: the copy can succeed even when models referenced by the source KB do not exist in the attacker tenant, indicating the workflow does not validate model ownership during copy.

PoC Video:

https://github.com/user-attachments/assets/8313fa44-5d5d-43f4-8ebd-f465c5a9d56e

Impact

This is a Broken Access Control (BOLA/IDOR) vulnerability enabling cross-tenant data exfiltration:

  • Any authenticated user can trigger a clone of a victim tenant’s knowledge base into their own tenant.
  • Results in bulk disclosure/duplication of knowledge base contents (documents/FAQ entries/chunks), plus associated configuration.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/Tencent/WeKnoraall versions0.3.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/Tencent/WeKnora. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update github.com/Tencent/WeKnora to 0.3.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8rf9-c59g-f82f is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-8rf9-c59g-f82f is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-8rf9-c59g-f82f. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary A cross-tenant authorization bypass in the knowledge base copy endpoint allows any authenticated user to clone (duplicate) another tenant’s knowledge base into their own tenant by knowing/guessing the source knowledge base ID. This enables bulk data exfiltration (document/FAQ content) across tenants, making the impact critical. ### Details The `POST /api/v1/knowledge-bases/copy` endpoint enqueues an asynchronous KB clone task using the caller-supplied `source_id` without verifying ownership (see `internal/handler/knowledgebase.go`). ```go // Create KB clone payload payload := typ
O3 Security · Impact-Aware SCA

Is GHSA-8rf9-c59g-f82f in your dependencies?

O3 detects GHSA-8rf9-c59g-f82f across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.