Opt-in trust for user-installed CA certificates (replace always-on src="user")

Open
#194 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
android

Research direction

Start with res/xml/network_security_config.xml and the linked Android security documentation to determine whether runtime opt-in trust for user-installed CAs is possible. Compare the approach used by the Nextcloud Files app for SSO traffic and investigate whether a custom or extended TrustManager is required. Done means documenting a viable approach and its scope, or establishing that the requested behavior is not feasible.

Written by the indexing model from the issue text.

Description

advanced

Problem

res/xml/network_security_config.xml trusts user-installed CAs for every host:

<base-config cleartextTrafficPermitted="false">
    <trust-anchors>
        <certificates src="system"/>
        <certificates src="user" tools:ignore="AcceptsUserCertificates" />
    </trust-anchors>
</base-config>

That is a MITM risk, especially for a password manager: any CA in the device user store can intercept HTTPS to Nextcloud. It exists so self-hosted servers with a private/internal CA still work.

Idea

Network Security Config cannot be toggled at runtime (it is compiled XML).
So the preferred way to trust user CAs only if the user enables it, needs a runtime solution, not a baked-in XML file solution.

Needs some research whether this is possible to solve at all.

Since SSO traffic goes through the Nextcloud Files app, may check how the files app handles that.

May we need to build an own TrustManager (or can extend the original one), but that needs definitely a lot of research or another app that already did that work :D

Dominant language
C++
Stars
103
Forks
31
Avg merge
10h 48m
Merged PRs (30d)
13

Getting set up

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.

More from nextcloud/passman-android

All issues in nextcloud/passman-android

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.