IQSS / IQSS/dataverse

Fail deployment when configuration for blocked api endpoints is invalid to avoid security issues

Open
#12,049 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Containers Feature: API Size: 30 Type: Feature User Role: Sysadmin
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

The configuration for blocked API endpoint basically allows any value.
In case of typos or misconfiguration (like a /api prefix due to copy+paste from Apache/NGINX rules), the rules are essentially rendered useless.

We must check during deployment if the setting is making any sense to us.

  1. Make sure there's no /, or /api or /api/v\d+/ at the beginning of each
  2. Make sure the list is actually a list (so no invalid characters like ; or , etc)
  3. Ideally check if the referred resource actually exists. (This might be hard to do!)

Also, the whole class of API filtering should be refactored:

  1. Extract the matching logic and have unit/integration/API tests
  2. Look into using UriInfo instead of or in addition to ResourceInfo to make the code potentially less complex
  3. Remove Jetty StringUtil (also add a check in Maven to flag or fail PRs introducing these imports!)
  4. Potentially make the class more restrictive in it's choices what are acceptable configuration combinations

In addition: the setup scripts are still applying database options for the blocking configuration. This should be cleaned up.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the blocked API endpoint configuration, its deployment validation, and the setup scripts that apply database options. Review the API filtering entry points and existing test coverage, then define completion as rejecting malformed configuration during deployment, covering matching behavior with tests, and cleaning the setup options.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, build-system, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.