Forgery and Tampering

Introduced in CS247.

Forgery: Creating invalid instances of an ADT. Tampering: Modifying a valid instance of an ADT to became invalid in an unexpected way.

Examples

Forgery

Node n {"bad ptr",  (Node *) 0x2117};
  • 0x2117 is a completely random memory address
  • Most likely, a segmentation fault on any kind of use.

Tampering

Example 1

Node n {"a", nullptr};
n.next = &n; // A cycle of 1 node

Example 2

Node n {"abc", nullptr};
Node p {"def", &n}; // Try to delete stack memory when the destructor runs

All these issues are from a common problem: Representation Exposure.