Skip to content
HackIndex logo

HackIndex

Detecting Weak Access Controls on Inference Endpoints

4 min read Mar 18, 2026

Model inference endpoints that lack proper access controls allow any client to query the model directly, bypassing application-layer restrictions, usage limits, content filtering, and audit logging. Missing authentication on a model server exposes the raw model without any of the guardrails the application layer applies. Weak authorization on an application proxy endpoint may allow access to models or capabilities not intended for the current user role. This page confirms which access control weaknesses are present before exploiting them.

Test for Unauthenticated Direct Model Access

Send a completion request with no authentication headers to each identified inference endpoint:

┌──(kali㉿kali)-[~]
└─$ curl -sk -X POST https://$TARGET_DOMAIN/api/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"gpt-4o","messages":[{"role":"user","content":"AUTH_TEST"}]}' | python3 -m json.tool
┌──(kali㉿kali)-[~]
└─$ curl -sk -X POST http://$TARGET_IP:11434/api/chat -H 'Content-Type: application/json' -d '{"model":"llama3.1","messages":[{"role":"user","content":"AUTH_TEST"}]}' | python3 -m json.tool

A successful completion response with no authentication confirms the endpoint is fully open. This bypasses every restriction the application layer imposes — content filtering, rate limiting, topic restrictions, and audit logging. The raw model is directly accessible.

Test API Key Strength and Bypass

When an API key is required, test whether the implementation is correctly enforced:

┌──(kali㉿kali)-[~]
└─$ curl -sk -X POST https://$TARGET_DOMAIN/api/v1/chat/completions -H 'Content-Type: application/json' -H 'Authorization: Bearer invalid-key-test' -d '{"messages":[{"role":"user","content":"test"}]}' | python3 -m json.tool
┌──(kali㉿kali)-[~]
└─$ curl -sk -X POST https://$TARGET_DOMAIN/api/v1/chat/completions -H 'Content-Type: application/json' -H 'Authorization: Bearer ' -d '{"messages":[{"role":"user","content":"test"}]}' | python3 -m json.tool
┌──(kali㉿kali)-[~]
└─$ curl -sk -X POST https://$TARGET_DOMAIN/api/v1/chat/completions -H 'Content-Type: application/json' -H 'Authorization: Bearer null' -d '{"messages":[{"role":"user","content":"test"}]}' | python3 -m json.tool

A successful response with an invalid, empty, or null token confirms authentication is not correctly enforced. Some implementations check for the presence of an Authorization header but not the validity of the token value.

Test for Horizontal Privilege Escalation

When authentication is present, test whether the endpoint enforces user-level isolation — can one user access another user's conversation history or agent context:

┌──(kali㉿kali)-[~]
└─$ curl -sk https://$TARGET_DOMAIN/api/conversations -H 'Authorization: Bearer $YOUR_TOKEN' | python3 -m json.tool
┌──(kali㉿kali)-[~]
└─$ curl -sk https://$TARGET_DOMAIN/api/conversations/OTHER_USER_CONVERSATION_ID -H 'Authorization: Bearer $YOUR_TOKEN' | python3 -m json.tool

Access to another user's conversation history confirms broken object-level authorization. In an AI context this exposes conversation content, any extracted information from tool calls, and agent memory associated with other users.

Test for Model Selection Bypass

Some deployments restrict which model a user can call. Test whether the model parameter can be freely changed to access more capable or less restricted models:

┌──(kali㉿kali)-[~]
└─$ for model in gpt-4o gpt-4 gpt-4-turbo gpt-3.5-turbo claude-3-5-sonnet-20241022 claude-3-opus-20240229 meta-llama/Llama-3.1-70B; do echo "Testing $model:"; curl -sk -X POST https://$TARGET_DOMAIN/api/v1/chat/completions -H 'Content-Type: application/json' -H 'Authorization: Bearer $TOKEN' -d "{\"model\":\"$model\",\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}" | python3 -c "import sys,json; r=json.load(sys.stdin); print('OK' if 'choices' in r else r.get('error',{}).get('message','?'))"; done

A successful response from a model the application does not normally expose confirms the model selection parameter is not validated server-side. This may allow access to more capable models than the application intends to provide, or models with different safety configurations.

Test Rate Limit Enforcement

Missing or weak rate limits on inference endpoints enable abuse that generates costs for the target organization and allows brute-force of injection payloads at scale:

┌──(kali㉿kali)-[~]
└─$ for i in $(seq 1 20); do curl -sk -X POST https://$TARGET_DOMAIN/api/chat -H 'Content-Type: application/json' -d '{"messages":[{"role":"user","content":"hi"}]}' -o /dev/null -w "%{http_code}\n"; done
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200

Twenty consecutive 200 responses with no rate limiting confirms the endpoint has no request throttling. This enables high-volume injection testing and extraction attacks without triggering automatic blocks.

References