.claude/skills/imperva-waf-bypass/SKILL.md
Fix for Python requests returning 500 "Internal Server Error" when calling APIs protected by Imperva/Incapsula WAF, while the same request works with curl. Use when: (1) API call works with curl but fails with Python requests, (2) response headers contain "X-CDN: Imperva" or Incapsula cookies, (3) API returns 500 with no JSON body, just "Internal Server Error" plain text, (4) response contains Set-Cookie with visid_incap_ or nlbi_ prefixes. Solves bot detection issues with Imperva-protected APIs like Resy, and other services using Imperva/Incapsula CDN.
npx skillsauth add Dbochman/dotfiles imperva-waf-python-requestsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Python requests library calls to an API return 500 Internal Server Error with
a plain text body, while the identical request via curl succeeds with 200. The
API is behind Imperva/Incapsula WAF which performs bot detection based on request
headers and TLS fingerprinting.
curl but returns 500 with Python requestsX-CDN: Impervavisid_incap_, nlbi_, or incap_ses_ prefixesAdd browser-like headers to your requests session:
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
"Accept": "application/json, text/plain, */*",
"Origin": "https://example.com", # The web app's origin
"Referer": "https://example.com/", # The web app's URL
}
The critical headers are:
python-requests/2.x by default which Imperva blocks.Origin and Referer may also be required depending on the API's CORS/WAF rules.
X-CDN: Imperva header is still present (confirms you're going through the same path)Before (blocked):
resp = requests.post("https://api.resy.com/3/auth/password",
headers={"Authorization": 'ResyAPI api_key="..."'},
data={"email": "[email protected]", "password": "pass"},
)
# resp.status_code == 500
# resp.text == "Internal Server Error"
After (works):
resp = requests.post("https://api.resy.com/3/auth/password",
headers={
"Authorization": 'ResyAPI api_key="..."',
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
"Accept": "application/json, text/plain, */*",
"Origin": "https://resy.com",
"Referer": "https://resy.com/",
},
data={"email": "[email protected]", "password": "pass"},
)
# resp.status_code == 200
# resp.json() == {"token": "...", ...}
curl works because it sends a different TLS fingerprint and default headers that Imperva doesn't flagdevelopment
Search the web for current information, news, facts, and answers. Use when asked questions about current events, needing to look something up, finding websites, researching topics, or when you need up-to-date information beyond your training data.
development
Summarize any URL, YouTube video, podcast, PDF, or file into concise text. Use when asked to read an article, summarize a link, get the gist of a video or podcast, extract content from a URL, or when you need to understand what a web page or document contains.
development
Play music via Spotify and control Google Home speakers. Use when asked to play music, songs, artists, playlists, podcasts, or control speakers/volume/audio.
testing
Create new OpenClaw skills, modify and improve existing skills, and measure skill performance with evals. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. Also use when asked to "make a skill", "turn this into a skill", "improve this skill", or "test this skill".