twisted / twisted/twisted

conch silently ignores keys of an incorrect type

Open
#7,060 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug conch new priority-normal
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

radix's avatar @radix reported
Trac ID trac#7060
Type defect
Created 2014-03-28 22:35:03Z
Branch https://github.com/twisted/twisted/tree/conch-bad-key-7060

This code is clearly bad:

    def _cbGetPublicKey(self, publicKey):
        if not isinstance(publicKey, keys.Key): # failure or None
            publicKey = None

To be explicit, it's bad because 1) it's assuming a more specific case when it only checks for a general case, and 2) it silently ignores (API) user input.

We should probably emit a warning when we got a non-None, non-Key result.

Searchable metadata
trac-id__7060 7060
type__defect defect
reporter__radix radix
priority__normal normal
milestone__ 
branch__branches_conch_bad_key_7060 branches/conch-bad-key-7060
branch_author__radix radix
status__new new
resolution__None None
component__conch conch
keywords__ 
time__1396046103000000 1396046103000000
changetime__1396079630000000 1396079630000000
version__None None
owner__radix radix
cc__z3p

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 conch implementation of _cbGetPublicKey and read how its public-key result is produced and consumed. Confirm the behavior for None, keys.Key, and other non-None results, then add coverage showing that an incorrect type emits a warning instead of being silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.