Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-3-5-haiku-20241022· AnthropicHugging Face LMArena Human Preference 140K

why not use GET for any (sensitive) state change

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514’s answer.
  1. User

    why not use GET for any (sensitive) state change

  2. Claude Assistant

    There are several important reasons why using GET requests for state changes or sensitive operations is not recommended:

    1. Security Risks
    • GET requests are fundamentally insecure for state changes because they:
      • Are logged in browser history
      • Appear in server logs
      • Can be cached by intermediary servers
      • Are visible in the URL, exposing potentially sensitive parameters
    1. Unintended Side Effects
    • GET requests are designed to be idempotent and safe, meaning they should not change server state
    • Browsers and web infrastructure (like caches) assume GET requests are read-only operations
    • Accidentally triggering state changes through GET can lead to unexpected behavior
    1. Data Exposure
    • Sensitive information in GET parameters becomes visible in:
      • Browser address bar
      • Bookmarks
      • Shared/forwarded URLs
      • Network traffic logs
    1. CSRF Vulnerability
    • GET requests are more susceptible to Cross-Site Request Forgery (CSRF) attacks
    • Malicious sites can easily trigger GET requests without user interaction
    1. Data Length Limitations
    • URLs have maximum length restrictions
    • Complex state changes might exceed these limits

    Best Practices:

    • Use POST for state changes
    • Use HTTPS to encrypt sensitive data
    • Implement CSRF tokens
    • Validate and sanitize all input parameters
    • Follow REST API design principles

    Proper approach is to use POST, PUT, PATCH, or DELETE methods for operations that modify server-side state.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.