Skip to content

Conversation

@tberchanov
Copy link

No description provided.


## 🚨 Critical Security Issues

### 1. No Signature Verification
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially this repo has an exact purpose - decode tokens, just to be able to fetch parts from string and use it. As initial codebase was not great from the implementation point of view, we can proceed with better implementation. I'm going to create an issue for this: #3

fun verify(jwt: JWT): VerificationResult
}

sealed class VerificationResult {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sealed interface

```

### 2. No Algorithm Validation
**Current State**: No validation of the algorithm specified in the JWT header.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a part of constructor and throw an exception?

### 3. No Input Validation
**Current State**: Accepts any string input without validation.

**Code Example**:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds valid.
Question - use required in constructor or throw other exceptions?


companion object {
private const val MAX_TOKEN_LENGTH = 8192
private val TOKEN_PATTERN = Regex("^[A-Za-z0-9+/=_-]+\\.([A-Za-z0-9+/=_-]+)\\.([A-Za-z0-9+/=_-]*)$")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation for non-regex friendly devs might be useful

### 16. Missing Sample Applications
**Current State**: No example applications demonstrating how to use the JWTDecode library.

**Missing Examples**:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

android & iOS app are present, for other platforms we are gonna go when basic APIs gonna be stable.


### 17. Add Key Management
**Implementation**:
```kotlin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope?

### 18. Add Streaming Support
**Implementation**:
```kotlin
// For large JWTs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope?

### 19. Add Batch Processing
**Implementation**:
```kotlin
interface JWTBatchProcessor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not our responsibility.

## 🔄 Future-Proofing Areas

### 20. Add Plugin System
**Implementation**:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants