Skip to content

Update qa tests to v1.0.12#280

Open
bitterpanda63 wants to merge 14 commits intomainfrom
update-qa-tests
Open

Update qa tests to v1.0.12#280
bitterpanda63 wants to merge 14 commits intomainfrom
update-qa-tests

Conversation

@bitterpanda63
Copy link
Copy Markdown
Member

@bitterpanda63 bitterpanda63 commented Apr 13, 2026

Summary by Aikido

Security Issues: 0 🔍 Quality Issues: 1 Resolved Issues: 0

⚡ Enhancements

  • Added thread-local bypassed context store and integrated bypass checks.
  • Normalized IPv4-mapped IPv6 addresses and adjusted IPList matching logic.
  • Normalized outbound domain hostnames using IDN and case-insensitive comparison.
  • Introduced DangerousBodyException and enforced JWT size and depth limits.
  • Updated QA workflow to use AikidoSec/firewall-tester-action v1.0.12.

More info

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026


// Block if the hostname is in the blocked domains list
if (ServiceConfigStore.shouldBlockOutgoingRequest(hostname)) {
if (ServiceConfigStore.shouldBlockOutgoingRequest(hostname) && !BypassedContextStore.isBypassed()) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

report(...) now includes enforcement via BypassedContextStore.isBypassed(), mixing reporting and blocking. Rename/split the method or document the enforcement behavior.

Details

✨ AI Reasoning
​The report(...) method in the DNSRecordCollector previously performed DNS-related reporting and SSRF detection. The recent change adds a bypass check and conditional blocking via BypassedContextStore.isBypassed(), introducing enforcement behavior into a method named 'report'. This increases mixing of responsibilities and makes the method's purpose less self-evident, especially when callers expect reporting-only side effects. The problematic change occurs where the blocking condition was tightened to include the bypass check.

🔧 How do I fix it?
Use descriptive verb-noun function names, add docstrings explaining the function's purpose, or provide meaningful return type hints.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Comment on lines +43 to 51
if (!bypassed) {
// Bypassed IPs are trusted — don't report their outbound hostnames in heartbeats.
if (!ports.isEmpty()) {
for (int port : ports) {
HostnamesStore.incrementHits(hostname, port);
}
} else {
HostnamesStore.incrementHits(hostname, 0);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if (!bypassed) block in report adds nesting around the main hostname-hit logic; invert the condition or use an early return/guard to flatten the method for clarity.

Show fix
Suggested change
if (!bypassed) {
// Bypassed IPs are trusted — don't report their outbound hostnames in heartbeats.
if (!ports.isEmpty()) {
for (int port : ports) {
HostnamesStore.incrementHits(hostname, port);
}
} else {
HostnamesStore.incrementHits(hostname, 0);
}
if (bypassed) {
// Bypassed IPs are trusted — don't report their outbound hostnames in heartbeats.
} else if (!ports.isEmpty()) {
for (int port : ports) {
HostnamesStore.incrementHits(hostname, port);
}
} else {
HostnamesStore.incrementHits(hostname, 0);
Details

✨ AI Reasoning
​The report method now computes a bypassed flag and then wraps hostname hit-incrementing logic inside an if (!bypassed) else branch, increasing nesting. This buries the normal-path behavior and makes the flow harder to follow; using an early return or inverting the condition would flatten the logic and improve readability.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant