Skip to content

Commit 6af1000

Browse files
authored
Merge pull request #84 from gladstone-9/BasicAuth_checker
For API Token Scanner, SCAN_FUNCTIONS=1 by default and updated description.
2 parents f8afc19 + b000890 commit 6af1000

3 files changed

Lines changed: 5 additions & 30 deletions

File tree

crates/forge_analyzer/src/checkers.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,10 +1203,10 @@ impl IntoVuln for AuthHeaderVuln {
12031203
AuthHeaderVulnKind::BasicAuth => Vulnerability {
12041204
check_name: format!("Custom-Check-Basic-Auth-{}", self.api_call),
12051205
description: format!(
1206-
"HTTP Basic authentication detected in {} {} call(s).",
1206+
"Our API Token Scanner has identified in {} {} call(s) that your app is currently using Atlassian API tokens for authentication. Under the [updated guidance](https://www.atlassian.com/blog/developer/building-secure-and-scalable-integrations-our-guidance-for-third-party-apps) on app authentication ([FAQ](https://developer.atlassian.com/platform/marketplace/security-requirements-faq/#are-apps-prohibited-from-collecting-atlassian-user-account-api-tokens-even-after-taking-the-user-s-consent-) page) apps collecting customer API tokens are now required to migrate to [Forge authentication](https://developer.atlassian.com/platform/forge/security/#simple-and-secure-authentication) to ensure alignment with cloud app [security requirements](https://developer.atlassian.com/platform/marketplace/security-requirements/#security-requirements-for-cloud-apps). Refer to this [announcement](https://community.developer.atlassian.com/t/reminder-migrate-from-using-api-tokens-to-officially-supported-authentication-for-atlassian-apps-integrations/97221) for more details.",
12071207
count, self.api_call
12081208
),
1209-
recommendation: "Use supported authentication mechanisms (such as OAuth 2.0 or Forge authentication). If you anticipate any blockers or require support, contact the Atlassian Ecosystem Security team.",
1209+
recommendation: "Use supported authentication mechanisms (such as OAuth 2.0 or Forge authentication). If you anticipate any blockers or require support, contact the Atlassian Ecosystem Support.",
12101210
proof: format!(
12111211
"Basic Authorization header found: {}",
12121212
proof_lines.join("; ")
@@ -1220,10 +1220,10 @@ impl IntoVuln for AuthHeaderVuln {
12201220
AuthHeaderVulnKind::BearerAdmin => Vulnerability {
12211221
check_name: "Bearer-Admin".to_string(),
12221222
description: format!(
1223-
"Bearer token used with Atlassian admin API in {} {} call(s).",
1223+
"Our API Token Scanner has identified in {} {} call(s) that your app is currently using Atlassian API tokens for authentication. Under the [updated guidance](https://www.atlassian.com/blog/developer/building-secure-and-scalable-integrations-our-guidance-for-third-party-apps) on app authentication ([FAQ](https://developer.atlassian.com/platform/marketplace/security-requirements-faq/#are-apps-prohibited-from-collecting-atlassian-user-account-api-tokens-even-after-taking-the-user-s-consent-) page) apps collecting customer API tokens are now required to migrate to [Forge authentication](https://developer.atlassian.com/platform/forge/security/#simple-and-secure-authentication) to ensure alignment with cloud app [security requirements](https://developer.atlassian.com/platform/marketplace/security-requirements/#security-requirements-for-cloud-apps). Refer to this [announcement](https://community.developer.atlassian.com/t/reminder-migrate-from-using-api-tokens-to-officially-supported-authentication-for-atlassian-apps-integrations/97221) for more details.",
12241224
count, self.api_call
12251225
),
1226-
recommendation: "Use supported authentication mechanisms (such as OAuth 2.0 or Forge authentication). If you anticipate any blockers or require support, contact the Atlassian Ecosystem Security team.",
1226+
recommendation: "Use supported authentication mechanisms (such as OAuth 2.0 or Forge authentication). If you anticipate any blockers or require support, contact the Atlassian Ecosystem Support.",
12271227
proof: format!(
12281228
"Bearer token on Atlassian admin API found: {}",
12291229
proof_lines.join("; ")

crates/fsrt/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub struct Args {
9595
scanners: Option<String>,
9696

9797
/// Scan all function/closure bodies for auth-header issues, not just entrypoint-reachable code.
98-
#[arg(long)]
98+
#[arg(long, default_value_t = true)]
9999
scan_functions: bool,
100100

101101
/// The directory to scan. Assumes there is a `manifest.ya?ml` file in the top level

crates/fsrt/src/test.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -930,31 +930,6 @@ fn basic_auth_on_platform_api_shims() {
930930
}
931931
}
932932

933-
// Unreachable class methods (not on an entry-point call chain) must not be
934-
// flagged by default — the analyzer only follows reachable code.
935-
#[test]
936-
fn basic_auth_in_unreachable_class_method_not_flagged() {
937-
let src = "// src/index.jsx
938-
import ForgeUI, { render, Macro, Fragment, Text } from '@forge/ui';
939-
import { requestJira, route } from '@forge/api';
940-
941-
export class BackupAdapter {
942-
async generateBackup(authKey) {
943-
await requestJira(route`/rest/backup/1/export/runbackup`, {
944-
method: 'POST',
945-
headers: { Authorization: `Basic ${authKey}`, Accept: 'application/json' },
946-
});
947-
}
948-
}
949-
950-
function App() { return <Fragment><Text>Hello</Text></Fragment>; }
951-
export const run = render(<Macro app={<App />} />);";
952-
953-
let result = scan_directory_test(MockForgeProject::files_from_string(src));
954-
assert!(result.contains_basic_auth_vuln(0));
955-
assert!(result.contains_secret_vuln(0));
956-
}
957-
958933
#[test]
959934
// Disabling test due to SSA Form fix changes.
960935
fn secret_vuln_fetch_header_reassigned() {

0 commit comments

Comments
 (0)