Skip to main content

SinkSite

Struct SinkSite 

Source
pub struct SinkSite {
Show 16 fields pub sink_shape: SinkShape, pub callee_path: String, pub arg_index: u32, pub arg_is_non_literal: bool, pub arg_kind: SinkArgKind, pub arg_literal: Option<SinkLiteralValue>, pub regex_pattern: Option<String>, pub object_properties: Vec<SinkObjectProperty>, pub object_property_keys: Vec<String>, pub object_property_keys_complete: bool, pub arg_idents: Vec<String>, pub arg_source_paths: Vec<String>, pub span_start: u32, pub span_end: u32, pub url_arg_literal: Option<String>, pub url_shape: Option<SecurityUrlShape>,
}
Expand description

A captured sink site. The visitor records every existing non-literal call / member-assign / member-call / tagged-template / jsx-attr sink site, and a small allowlist of literal-aware sites where the literal value is the signal. It knows nothing about CWE categories.

Fields§

§sink_shape: SinkShape

The syntactic shape of the sink site.

§callee_path: String

The flattened dotted/bare callee or member path.

§arg_index: u32

The positional argument index. For zero-argument captures this is 0.

§arg_is_non_literal: bool

Whether the relevant argument is non-literal. Existing non-literal catalogue rows require this to remain true.

§arg_kind: SinkArgKind

The finer-grained shape of the captured argument. Lets the catalogue require unsafe shapes (concat / template-with-substitution / literal / no-arg) and exclude safe ones (object literal, the parameterized form). See SinkArgKind.

§arg_literal: Option<SinkLiteralValue>

Literal argument value for literal-aware rows.

§regex_pattern: Option<String>

Risky regex fragment for structural ReDoS candidates.

§object_properties: Vec<SinkObjectProperty>

Static object-literal properties for option-object rows.

§object_property_keys: Vec<String>

Static top-level object-literal keys, including keys whose values are not literal. Used by missing-option rows that only need key presence.

§object_property_keys_complete: bool

Whether object_property_keys is complete. False for non-object arguments and object literals with spread or non-static keys, where a missing-key claim would be speculative.

§arg_idents: Vec<String>

Identifier names referenced anywhere inside the captured non-literal sink argument, or contextual names for zero-argument captures such as a token-like Math.random() assignment target. Deduped in source order. Used by the analyze layer to back-trace the sink argument to a known untrusted source or to apply narrow context gates. Intra-module, name-based, conservative; it is never a taint proof.

§arg_source_paths: Vec<String>

Flattened static member paths referenced inside the captured non-literal sink argument. Includes both the full path and source-object path for leaf reads (process.env.SECRET records process.env.SECRET and process.env) so direct source expressions can be matched without an intermediate local binding.

§span_start: u32

Byte offset of the sink span start. Stored as u32 (not Span) so the struct is bitcode-encodable and can be persisted directly in the cache.

§span_end: u32

Byte offset of the sink span end.

§url_arg_literal: Option<String>

The arg-0 URL string literal of a network-shaped call (fetch, axios.*, got, …), captured so the secret-to-network category (#890) can carry a destination-host signal on its candidate: Some(literal) when the destination is a static string literal (almost always intended auth, e.g. the credential’s own provider), None when it is dynamic (the suspicious case). None for non-call sinks and calls with no arg 0.

§url_shape: Option<SecurityUrlShape>

URL construction shape for URL-like sink arguments when the extractor can classify it syntactically. None for non-URL sinks and URL expressions whose shape is not visible at the sink.

Implementations§

Source§

impl SinkSite

Source

pub fn span(&self) -> Span

Reconstruct the source span from the stored byte offsets.

Trait Implementations§

Source§

impl Clone for SinkSite

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SinkSite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'__de> Decode<'__de> for SinkSite
where '__de:,

Source§

impl<'de> Deserialize<'de> for SinkSite

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encode for SinkSite

Source§

impl Serialize for SinkSite

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DecodeOwned for T
where T: for<'de> Decode<'de>,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.