# AWS - SQS Privesc

{{#include ../../../banners/hacktricks-training.md}}

## SQS

For more information check:

{{#ref}}
../aws-services/aws-sqs-and-sns-enum.md
{{#endref}}

### `sqs:AddPermission`

An attacker could use this permission to grant unauthorized users or services access to an SQS queue by creating new policies or modifying existing policies. This could result in unauthorized access to the messages in the queue or manipulation of the queue by unauthorized entities.

```bash
cssCopy codeaws sqs add-permission --queue-url <value> --actions <value> --aws-account-ids <value> --label <value>
```

**Potential Impact**: Unauthorized access to the queue, message exposure, or queue manipulation by unauthorized users or services.

### `sqs:SendMessage` , `sqs:SendMessageBatch`

An attacker could send malicious or unwanted messages to the SQS queue, potentially causing data corruption, triggering unintended actions, or exhausting resources.

```bash
aws sqs send-message --queue-url <value> --message-body <value>
aws sqs send-message-batch --queue-url <value> --entries <value>
```

**Potential Impact**: Vulnerability exploitation, Data corruption, unintended actions, or resource exhaustion.

### `sqs:ReceiveMessage`, `sqs:DeleteMessage`, `sqs:ChangeMessageVisibility`

An attacker could receive, delete, or modify the visibility of messages in an SQS queue, causing message loss, data corruption, or service disruption for applications relying on those messages.

```bash
aws sqs receive-message --queue-url <value>
aws sqs delete-message --queue-url <value> --receipt-handle <value>
aws sqs change-message-visibility --queue-url <value> --receipt-handle <value> --visibility-timeout <value>
```

**Potential Impact**: Steal sensitive information, Message loss, data corruption, and service disruption for applications relying on the affected messages.

{{#include ../../../banners/hacktricks-training.md}}




