Skip to content

Conversation

@jentfoo
Copy link
Contributor

@jentfoo jentfoo commented Aug 27, 2024

This commit adds additional checks to validate that Attribute Name / Values are not empty or contain a slash. This fixes a panic condition where NewAttributeValueFQN would return without error but Prefix() would then fail when the prefix is attempted to be parsed by NewAttributeNameFQN.

This commit includes unit testing, and the fuzz testing that initially discovered this issue. See there for possibly dangerous values.

An alternative or additional solution that we may want to consider:
If Prefix() is a common or frequent operation we could proactively invoke the NewAttributeNameFQN from within NewAttributeValueFQN. That way any future validation added to NewAttributeNameFQN would be proactively checked rather than needing Prefix() to be invoked to be tested.

Also included are some minor doc changes, spelling fixes, and some other fuzz testing that was co-located with these changes.

PR closes #1468

@jentfoo jentfoo self-assigned this Aug 27, 2024
@jentfoo jentfoo requested review from a team as code owners August 27, 2024 18:56
@jentfoo jentfoo changed the title fix(sdk): Fix possible granter.go panics for AttributeValueFQN.Prefix() fix(sdk): Fix possible panic for AttributeValueFQN.Prefix() Aug 27, 2024
@jentfoo jentfoo force-pushed the jent/granter_panic_fix branch 2 times, most recently from 2212de8 to 0981203 Compare August 27, 2024 19:03
This commit adds additional checks to validate that Attribute Name / Values are not empty or contain a slash.  This fixes a panic condition where `NewAttributeValueFQN` would return without error but `Prefix()` would then fail when the prefix is attempted to be parsed by `NewAttributeNameFQN`.

This commit includes unit testing, and the fuzz testing that initially discovered this issue.  See there for possibly dangerous values.

Also included are some minor doc changes, spelling fixes, and some other fuzz testing that was co-located with these changes.
Copy link
Member

@jrschumacher jrschumacher left a comment

Choose a reason for hiding this comment

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

Really awesome to see these contributions!! Thank you.

@jentfoo jentfoo added this pull request to the merge queue Sep 3, 2024
Merged via the queue into main with commit 144aeda Sep 3, 2024
@jentfoo jentfoo deleted the jent/granter_panic_fix branch September 3, 2024 15:09
github-merge-queue bot pushed a commit that referenced this pull request Sep 4, 2024
This PR includes additional fuzzing and security testing that was not
covered in prior PR's (#1472 and #1385). Those PR's include the relevant
tests for their fixes, where this provides additional testing that was
explored but did not show issues.

In addition this PR includes some minor changes that were found while
reviewing the code base:
* Spelling fixes
* Token issue time and expiration based off the same time sample
(reduced kernel overheads and also ensures no time skew risks)

PR closes #1341
github-merge-queue bot pushed a commit that referenced this pull request Oct 1, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.3.13](sdk/v0.3.12...sdk/v0.3.13)
(2024-10-01)


### Features

* **sdk:** Add namesapce grants to key splitting
([#1512](#1512))
([d9a07f8](d9a07f8))


### Bug Fixes

* **ci:** Fix negative assertion test case false positive
([#1550](#1550))
([ef40bdb](ef40bdb))
* **core:** Add NanoTDF KID padding removal and update logging level
([#1466](#1466))
([54de8f4](54de8f4)),
closes [#1467](#1467)
* **core:** Autobump sdk
([#1513](#1513))
([03fba13](03fba13))
* **core:** Autobump sdk
([#1577](#1577))
([df7466b](df7466b))
* **core:** only strip nano kids to the right
([#1475](#1475))
([ae8d8a2](ae8d8a2))
* **core:** Store attribute specific grants to key cache
([#1507](#1507))
([8bc0a98](8bc0a98))
* **sdk:** DoS protection through TDF segment sizes
([#1536](#1536))
([d506734](d506734))
* **sdk:** Fix nanotdf ECC mode bitfield
([#1551](#1551))
([58a76ad](58a76ad))
* **sdk:** Fix possible panic for `AttributeValueFQN.Prefix()`
([#1472](#1472))
([144aeda](144aeda))
* **sdk:** Granter offline mode with namespaces and keycache
([#1542](#1542))
([ecd41f4](ecd41f4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
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.

Panic possible in granter with possible invalid name and value inputs

4 participants