0

Most people as they surf the web would get a warning by their browser if they approach a website with an SSL certificate issued by an unnknown authority, or even known as malicious place.

Now, thousands of developers - over 80% of Java related projects using Maven Central - download software components known to have vulnerabilties, sometimes there are even judicial conseqences.

Then, I thought to discuss a plugin for a binary repository coupled with the NVD database to issue a warning HTTP header if a client requests a component with a known vulnerability.

Which HTTP code is to use for that - if a non-opiniated option is anyhow possible? I fail to identify it myself in the list of known codes.

UPD the answer of the server is basically file download, if this happens you see Maven log like "download ok" and if this is not ok, the build would break. So search for a "soft" method to filter out problematic resources.

asked Mar 5, 2018 at 15:03

1 Answer 1

3

If the purpose of your webserver is to tell that some resource should not be used because deemed insecure, why not sending 404? Or even the stronger 410.

If the purpose is instead to deliver the resource but at the same time to warn about some insecure situation, I do not believe you can do that with an HTTP header.

But if you want to deliver useful detailed messages to the client, you should reply 200 with the body being a JSON document or something like that coding for all messages you want to give the client.

answered Mar 5, 2018 at 15:16
2
  • Hi, Patrick, thanks - given that the client is headless I can't display anything. Commented Mar 5, 2018 at 16:12
  • 1
    So you are either strict and deny the access completely (404, 410, etc.) or you want/need to be nicer and then just let the access pass through but you record this "insecure delivery" in your log files on the server side and then act on it in some way out of band. You could also add any X-Something HTTP header (while it is a little frowned upon) in your reply, but then if the client does nothing with them it is pointless. Commented Mar 5, 2018 at 16:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.