Enum TaintSource
pub enum TaintSource {
Unknown,
Parameter(u16),
Local(u16),
Field(u32),
StaticField(u32),
ArrayElement,
MethodReturn(u32),
UserInput,
ExternalData,
Computation,
Constant,
Exception,
}Expand description
Source/origin of a symbolic value for taint tracking.
Taint sources identify where symbolic values originate, enabling data flow analysis and security auditing. Some sources are considered “tainted” (potentially malicious), while others are neutral.
§Taint Propagation
When operations are performed on tainted values, the result is also
tainted. The TaintSource::Computation variant is used for values
derived from other values.
Variants§
Unknown
Origin is unknown.
This is the default for values that cannot be tracked. Not considered tainted.
Parameter(u16)
Value comes from a method parameter.
Parameters are considered tainted because they come from outside the current method’s control.
Local(u16)
Value comes from a local variable that was initialized symbolically.
Locals are considered tainted if they were never assigned a concrete value.
Field(u32)
Value comes from a field load.
The u32 is the field’s metadata token.
StaticField(u32)
Value comes from a static field load.
Static fields are potentially tainted as they can be modified by other code.
ArrayElement
Value comes from an array element load.
MethodReturn(u32)
Value comes from a method return value.
The u32 is the called method’s metadata token.
UserInput
Value comes from external/user input (e.g., Console.ReadLine).
Always tainted - represents potentially malicious data.
ExternalData
Value comes from a file, network, or other external source.
Always tainted - represents potentially malicious data.
Computation
Value was computed from other values.
Taint status depends on the input values’ taint status. If any input is tainted, the computation result is tainted.
Constant
Value comes from a constant in the metadata.
Constants are not tainted as they are embedded in the assembly.
Exception
Value comes from exception handling (catch block).
Implementations§
§impl TaintSource
impl TaintSource
pub fn is_tainted(&self) -> bool
pub fn is_tainted(&self) -> bool
Returns true if this source is considered tainted.
Tainted sources include:
- User input
- External data
- Parameters (untrusted input)
- Fields (can be modified externally)
- Array elements (contents can change)
- Method returns (behavior unknown)
pub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Returns a human-readable description of this source.
Trait Implementations§
§impl Clone for TaintSource
impl Clone for TaintSource
§fn clone(&self) -> TaintSource
fn clone(&self) -> TaintSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for TaintSource
impl Debug for TaintSource
§impl Display for TaintSource
impl Display for TaintSource
§impl Hash for TaintSource
impl Hash for TaintSource
§impl PartialEq for TaintSource
impl PartialEq for TaintSource
impl Eq for TaintSource
impl StructuralPartialEq for TaintSource
Auto Trait Implementations§
impl Freeze for TaintSource
impl RefUnwindSafe for TaintSource
impl Send for TaintSource
impl Sync for TaintSource
impl Unpin for TaintSource
impl UnwindSafe for TaintSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more