Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dolos error for both Docker and Python versions - HTTPError: 400 Client Error: Bad Request for url: https://playground.rebuff.ai/api/detect #13

Open
tacocat31415 opened this issue Sep 26, 2024 · 1 comment

Comments

@tacocat31415
Copy link

In June 2024 I ran the software successfully. Now in Sept 2024 I am getting this error with both docker and python versions. The environment keys used do contain current API keys. Is there extract debugging I can do with python app to get more details about what it is sending to that Rebuff API endpoint?

Here is what I ran:
$ sudo docker run --rm -p 5000:5000 -ti dolos_ml_ctf --rebuffkey=$REBUFF_API_KEY
--openaikey=$OPENAI_API_KEY

Error occurs when any input in entered via the web UI on localhost:5000.

Here is console where docker was launched:
Running...

╔╦╗╔═╗╦ ╔═╗┌─┐ ╔╦╗╦ ╔═╗╔╦╗╔═╗ ╔═╗┬ ┬┌─┐┬ ┬ ┌─┐┌┐┌┌─┐┌─┐
║║║ ║║ ║ ║└─┐ ║║║║ ║ ║ ╠╣ ║ ├─┤├─┤│ │ ├┤ ││││ ┬├┤
═╩╝╚═╝╩═╝╚═╝└─┘ ╩ ╩╩═╝ ╚═╝ ╩ ╚ ╚═╝┴ ┴┴ ┴┴─┘┴─┘└─┘┘└┘└─┘└─┘

Author: Alex Devassy
Access http://127.0.0.1:5000/
Category: Prompt Injection Attack
Description: Flag is at same directory as of flask app, [FLAG].txt.
Press Ctrl+C to quit

  • Serving Flask app 'app'
  • Debug mode: off
    [2024-09-26 02:25:56,865] ERROR in app: Exception on /chat [POST]
    Traceback (most recent call last):
    File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
    File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
    File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
    File "/app/app.py", line 52, in chat
    result = rb.detect_injection(user_input)
    File "/usr/local/lib/python3.10/dist-packages/rebuff/rebuff.py", line 89, in detect_injection
    response.raise_for_status()
    File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://playground.rebuff.ai/api/detect
@GangGreenTemperTatum
Copy link

only way would be to live debug the app, then rebuild docker etc
i think rebuff updated their API structure and its now a malformed request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants