Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(auth): do more validation of TLV messages #4064

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

eventualbuddha
Copy link
Collaborator

Overview

We were not validating:

  • that the encoded tag is the one we expected
  • that the first length byte is ≤ 0x80 if it isn't one of the special 0x81 or 0x82 values
  • that the TLV response didn't contain more data than the length said it should

See Slack discussion.

Demo Video or Screenshot

n/a

Testing Plan

Automated, manually tested that programming a sysadmin card and using it in VxScan still works.

We were not validating:
- that the encoded tag is the one we expected
- that the first length byte is ≤ 0x80 if it isn't one of the special 0x81 or 0x82 values
- that the TLV response didn't contain more data than the length said it should
@eventualbuddha eventualbuddha requested review from arsalansufi and a team as code owners October 10, 2023 22:59
@eventualbuddha eventualbuddha requested review from carolinemodic and removed request for a team October 10, 2023 22:59
Copy link
Contributor

@arsalansufi arsalansufi left a comment

Choose a reason for hiding this comment

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

Thank you for updating! A few nits

libs/auth/src/apdu.ts Outdated Show resolved Hide resolved
libs/auth/src/apdu.ts Show resolved Hide resolved
libs/auth/src/apdu.ts Outdated Show resolved Hide resolved
libs/auth/src/apdu.ts Outdated Show resolved Hide resolved
libs/auth/src/apdu.ts Show resolved Hide resolved
Copy link
Contributor

@arsalansufi arsalansufi left a comment

Choose a reason for hiding this comment

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

LGTM!

libs/auth/src/apdu.ts Outdated Show resolved Hide resolved
@eventualbuddha eventualbuddha enabled auto-merge (squash) October 11, 2023 16:31
@eventualbuddha eventualbuddha merged commit 7043a1a into main Oct 11, 2023
@eventualbuddha eventualbuddha deleted the brian/fix/auth/validate-tlv branch October 11, 2023 16:35
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.

2 participants