Skip to main content
Glama

security.test_idor

Test for IDOR vulnerabilities by analyzing URLs with ID parameters to detect insecure direct object references in web applications.

Instructions

Test for IDOR (Insecure Direct Object Reference) vulnerabilities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL with ID parameter
idParamNoID parameter nameid
testIdsNoIDs to test (e.g., [1, 2, 3])

Implementation Reference

  • The handler function for 'security.test_idor' that tests for IDOR vulnerabilities by sending requests with different test IDs (default [1,2,3,999,1000]), compares responses to detect unauthorized access, saves findings if potential vuln detected, and returns formatted results.
    async ({ url, idParam = 'id', testIds = [1, 2, 3, 999, 1000] }: any): Promise<ToolResult> => {
      try {
        const results: any[] = [];
        let baselineResponse: AxiosResponse | null = null;
    
        for (const testId of testIds) {
          try {
            const response = await axios.get(url, {
              params: { [idParam]: testId },
              validateStatus: () => true,
              timeout: 15000,
            });
    
            if (!baselineResponse) {
              baselineResponse = response;
            }
    
            const isDifferent = response.status !== baselineResponse.status ||
              response.data !== baselineResponse.data;
    
            const result = {
              id: testId,
              status: response.status,
              length: typeof response.data === 'string' 
                ? response.data.length 
                : JSON.stringify(response.data).length,
              isDifferent,
              accessible: response.status === 200,
            };
    
            if (isDifferent && response.status === 200) {
              await saveFinding({
                target: url,
                type: 'IDOR',
                severity: 'high',
                description: `Potential IDOR - different response for ID: ${testId}`,
                payload: `${idParam}=${testId}`,
                response: typeof response.data === 'string' 
                  ? response.data.substring(0, 1000)
                  : JSON.stringify(response.data).substring(0, 1000),
                timestamp: new Date(),
                score: 7,
              });
            }
    
            results.push(result);
          } catch (error: any) {
            results.push({
              id: testId,
              error: error.message,
            });
          }
        }
    
        const idorScore = results.some((r: any) => r.vulnerable) ? 8 : 4;
        await saveTestResult(url, 'idor_test', true, { results }, undefined, idorScore, JSON.stringify(testIds), JSON.stringify(results));
    
        return formatToolResult(true, {
          results,
          summary: {
            totalTests: testIds.length,
            accessible: results.filter((r) => r.accessible).length,
            potentialVulns: results.filter((r) => r.isDifferent && r.accessible).length,
          },
        });
      } catch (error: any) {
        await saveTestResult(url, 'idor_test', false, null, error.message, 0, JSON.stringify(testIds), undefined);
        return formatToolResult(false, null, error.message);
      }
    }
  • Input schema for the 'security.test_idor' tool defining parameters: url (required), idParam (default 'id'), testIds (array of numbers).
      type: 'object',
      properties: {
        url: { type: 'string', description: 'Target URL with ID parameter' },
        idParam: { type: 'string', description: 'ID parameter name', default: 'id' },
        testIds: {
          type: 'array',
          items: { type: 'number' },
          description: 'IDs to test (e.g., [1, 2, 3])',
        },
      },
      required: ['url'],
    },
  • Registration of the 'security.test_idor' tool using server.tool(), including description, inputSchema, and handler function reference.
      'security.test_idor',
      {
        description: 'Test for IDOR (Insecure Direct Object Reference) vulnerabilities',
        inputSchema: {
          type: 'object',
          properties: {
            url: { type: 'string', description: 'Target URL with ID parameter' },
            idParam: { type: 'string', description: 'ID parameter name', default: 'id' },
            testIds: {
              type: 'array',
              items: { type: 'number' },
              description: 'IDs to test (e.g., [1, 2, 3])',
            },
          },
          required: ['url'],
        },
      },
      async ({ url, idParam = 'id', testIds = [1, 2, 3, 999, 1000] }: any): Promise<ToolResult> => {
        try {
          const results: any[] = [];
          let baselineResponse: AxiosResponse | null = null;
    
          for (const testId of testIds) {
            try {
              const response = await axios.get(url, {
                params: { [idParam]: testId },
                validateStatus: () => true,
                timeout: 15000,
              });
    
              if (!baselineResponse) {
                baselineResponse = response;
              }
    
              const isDifferent = response.status !== baselineResponse.status ||
                response.data !== baselineResponse.data;
    
              const result = {
                id: testId,
                status: response.status,
                length: typeof response.data === 'string' 
                  ? response.data.length 
                  : JSON.stringify(response.data).length,
                isDifferent,
                accessible: response.status === 200,
              };
    
              if (isDifferent && response.status === 200) {
                await saveFinding({
                  target: url,
                  type: 'IDOR',
                  severity: 'high',
                  description: `Potential IDOR - different response for ID: ${testId}`,
                  payload: `${idParam}=${testId}`,
                  response: typeof response.data === 'string' 
                    ? response.data.substring(0, 1000)
                    : JSON.stringify(response.data).substring(0, 1000),
                  timestamp: new Date(),
                  score: 7,
                });
              }
    
              results.push(result);
            } catch (error: any) {
              results.push({
                id: testId,
                error: error.message,
              });
            }
          }
    
          const idorScore = results.some((r: any) => r.vulnerable) ? 8 : 4;
          await saveTestResult(url, 'idor_test', true, { results }, undefined, idorScore, JSON.stringify(testIds), JSON.stringify(results));
    
          return formatToolResult(true, {
            results,
            summary: {
              totalTests: testIds.length,
              accessible: results.filter((r) => r.accessible).length,
              potentialVulns: results.filter((r) => r.isDifferent && r.accessible).length,
            },
          });
        } catch (error: any) {
          await saveTestResult(url, 'idor_test', false, null, error.message, 0, JSON.stringify(testIds), undefined);
          return formatToolResult(false, null, error.message);
        }
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states what the tool does (tests for IDOR) but doesn't disclose how it behaves: whether it makes HTTP requests, what HTTP methods it uses, whether it requires authentication, what constitutes a positive finding, rate limits, or potential side effects. For a security testing tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a tool with a clear, narrow purpose and doesn't bury key information. Every word earns its place by directly stating the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a security testing tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (success/failure indicators, vulnerability details), what side effects it might have (e.g., generating traffic, triggering alerts), or operational constraints. For a tool that likely makes network requests and analyzes responses, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no parameter semantics beyond what's already in the schema (e.g., it doesn't explain what constitutes a valid 'url' format, how 'testIds' should be chosen, or what 'idParam' mapping means). Baseline 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Test for IDOR (Insecure Direct Object Reference) vulnerabilities' - a specific verb ('Test') with a specific security vulnerability type. It distinguishes from siblings like 'security.test_sqli' or 'security.test_xss' by focusing on IDOR. However, it doesn't specify what resource or target it tests (e.g., web applications, APIs), which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing authenticated sessions, specific application states), nor does it differentiate from similar security testing tools like 'security.test_auth_bypass' or 'security.test_csrf'. The agent must infer usage context from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/telmon95/VulneraMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server